doriannjeshi
Active Member
- Joined
- Apr 5, 2015
- Messages
- 338
- Office Version
- 365
- Platform
- Windows
Hello,
I need to modify this macro to apply to all comments in the active SELECTION please:
I need to modify this macro to apply to all comments in the active SELECTION please:
VBA Code:
Option Explicit
Sub test()
Dim lArea As Long, h As Long, n As Long
Dim cmt As Comment '<- added
For Each cmt In ActiveSheet.Comments '<- added
With cmt '<- changed
n = WorksheetFunction.RoundUp(Len(.Text) / 100, 0)
.Shape.TextFrame.AutoSize = True
h = .Shape.Height
If .Shape.Width > 400 Then
.Shape.Width = 400
.Shape.Height = h * n
End If
End With
Next cmt '<- added
End Sub
Last edited by a moderator: