|
发表于 2015-3-18 10:19
|
显示全部楼层
本楼为最佳答案
Sub Macro1()
Dim j%, s
On Error Resume Next
Sheets(1).Activate
mymax = 0
For j = 6 To 10
If Cells(10, j).Value > 0 Then
x = Len(Cells(9, j)) + Len(Cells(10, j))
If mymax < x Then mymax = x
End If
Next
For j = 6 To 10
If Cells(10, j).Value > 0 Then
x = Len(Cells(9, j)) + Len(Cells(10, j))
x2 = mymax - x
s = s & Cells(9, j) & String(x2, " ") & Cells(10, j) & "股" & Chr(10)
End If
Next
Cells(5, 5).Comment.Delete
Cells(5, 5).AddComment
With Cells(5, 5).Comment
.Visible = False
.Text Text:=Mid(s, 1, Len(s) - 1)
.Shape.TextFrame.AutoSize = True
.Shape.TextFrame.Characters.Font.Name = "宋体"
.Shape.TextFrame.Characters.Font.FontStyle = "加粗"
.Shape.TextFrame.Characters.Font.Size = 9
End With
End Sub
|
评分
-
查看全部评分
|