brucewflee
New Member
- Joined
- Nov 8, 2014
- Messages
- 12
Hi,
I have been using the following macro to edit the font and size of my comment box.
However, with my sheet getting larger and larger, the time it is being used when I run this macro is getting longer. Is there a way I can select the cells I want to apply the macro instead to speed up the process?
I have tried using "For each cell in Selection.Cells" but it is still running the whole sheet unfortunately.
I have been using the following macro to edit the font and size of my comment box.
Code:
Sub FixComments()
Dim MyComments As Comment
For Each MyComments In ActiveSheet.Comments
With MyComments
.Shape.TextFrame.AutoSize = True
If .Shape.Width > 300 Then
Dim lArea As Long
lArea = .Shape.Width * .Shape.Height
.Shape.Width = 250
.Shape.Height = (lArea / 200) * 1.1
End If
End With
With MyComments.Shape.TextFrame.Characters.Font
.Name = "Tahoma"
.Size = 10
.Bold = False
End With
Next MyComments
End Sub
However, with my sheet getting larger and larger, the time it is being used when I run this macro is getting longer. Is there a way I can select the cells I want to apply the macro instead to speed up the process?
I have tried using "For each cell in Selection.Cells" but it is still running the whole sheet unfortunately.