Modifiy

mayoung

Active Member
Joined
Mar 26, 2014
Messages
257
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I accidentally submitted this with wrong subject. I wanted it to say Modify Comment. I tried to modify or delete and start over but do know how to do either.

But ...

How can this be modified so it works with a Range or Activecell. I have tried several combinations without success.





VBA Code:
Sub ModifiyComments()
Dim MyComments As Comment
Dim LArea As Long
For Each MyComments In ActiveSheet.Comments
With MyComments
.Shape.AutoShapeType = msoShapeRoundedRectangle
.Shape.TextFrame.Characters.Font.Name = "Tahoma"
.Shape.TextFrame.Characters.Font.Size = 8
.Shape.TextFrame.Characters.Font.ColorIndex = 2
.Shape.Line.ForeColor.RGB = RGB(0, 0, 0)
.Shape.Line.BackColor.RGB = RGB(255, 255, 255)
.Shape.Fill.Visible = msoTrue
.Shape.Fill.ForeColor.RGB = RGB(58, 82, 184)
.Shape.Fill.OneColorGradient msoGradientDiagonalUp, 1, 0.23
End With
Next 'comment
End Sub
 
Last edited:

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Do you just want to change the comment for one cell, or a range of cells?
 
Upvote 0
If the the Range could be adjusted to do one cell like Range(“C2”) or do a group though adjusting the range Range(”C2:E10) etc
 
Upvote 0
How about
VBA Code:
Sub ModifiyComments()
Dim Cl As Range
For Each Cl In Range("C2:E10")
   If Not Cl.Comment Is Nothing Then
      With Cl.Comment
         .Shape.AutoShapeType = msoShapeRoundedRectangle
         .Shape.TextFrame.Characters.Font.Name = "Tahoma"
         .Shape.TextFrame.Characters.Font.Size = 8
         .Shape.TextFrame.Characters.Font.ColorIndex = 2
         .Shape.Line.ForeColor.RGB = RGB(0, 0, 0)
         .Shape.Line.BackColor.RGB = RGB(255, 255, 255)
         .Shape.Fill.Visible = msoTrue
         .Shape.Fill.ForeColor.RGB = RGB(58, 82, 184)
         .Shape.Fill.OneColorGradient msoGradientDiagonalUp, 1, 0.23
      End With
   End If
Next 'comment
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top