G
Guest
Hi. Excel 2003
3 questions
1. I have about 300 comment boxes to format. I just need to make them all
the same size. I'm not worried about anything else.
Debra's code should work, but it makes them about .3" inches by .3" inches.
Can anyone help me adapt her code to make my boxes 1.8" tall by 1.5" wide.
Here is her code:
Sub ResizeCommentsInSelection()
'Posted by Dave Peterson 2002-02-25
Dim mycell As Range
Dim myRng As Range
Dim lArea As Long
Set myRng = Selection
For Each mycell In myRng.Cells
If Not (mycell.Comment Is Nothing) Then
With mycell.Comment
.Shape.TextFrame.AutoSize = True
If .Shape.Width > 300 Then
lArea = .Shape.Width * .Shape.Height
.Shape.Width = 200
.Shape.Height = (lArea / 200) * 1.2
End If
End With
End If
Next mycell
End Sub
2. How do I enter the code?
I assume I right click on the sheet tab,select view code, copy and paste.
Then do I need to click run or do I just save the code to my spreadsheet and
it will take care of itself.
3. I would imagine that I need to make sure that all cells are unlocked?
Thanks in advance
3 questions
1. I have about 300 comment boxes to format. I just need to make them all
the same size. I'm not worried about anything else.
Debra's code should work, but it makes them about .3" inches by .3" inches.
Can anyone help me adapt her code to make my boxes 1.8" tall by 1.5" wide.
Here is her code:
Sub ResizeCommentsInSelection()
'Posted by Dave Peterson 2002-02-25
Dim mycell As Range
Dim myRng As Range
Dim lArea As Long
Set myRng = Selection
For Each mycell In myRng.Cells
If Not (mycell.Comment Is Nothing) Then
With mycell.Comment
.Shape.TextFrame.AutoSize = True
If .Shape.Width > 300 Then
lArea = .Shape.Width * .Shape.Height
.Shape.Width = 200
.Shape.Height = (lArea / 200) * 1.2
End If
End With
End If
Next mycell
End Sub
2. How do I enter the code?
I assume I right click on the sheet tab,select view code, copy and paste.
Then do I need to click run or do I just save the code to my spreadsheet and
it will take care of itself.
3. I would imagine that I need to make sure that all cells are unlocked?
Thanks in advance