Code to add comments to selected cells within a selected range
On Tuesday, January 28, 2014 1:40:07 AM UTC-8, Claus Busch wrote:
Hi again,
sorry, the IF statement is not ok
Try:
Sub MySelectedRange()
myCheck = MsgBox("Do you want add comments?", vbYesNo)
If myCheck = vbYes Then
Set rRange = Application.InputBox("With the ctrl key held down, "
_
& "use your mouse" & vbCr & _
"to click on the cells you want to add a Comment.", _
"Comment This Hour", Type:=8)
For Each rngC In rRange
If rngC.Comment Is Nothing Then
myCom = Application.InputBox("Enter your comment text for " _
& rngC.Address(0, 0), "My comment", Type:=2)
If myCom = "" Or myCom = "Falsch" Then GoTo SKIP
rngC.AddComment myCom
End If
SKIP:
Next
End If
End Sub
Regards
Claus B.
Hi Claus,
Now that is a work of art!
I figured out how to add a standard label or heading if one wants to.
rngC.AddComment """Booger: """ & myCom
I will also see if I can declare a variable and give it a value from a cell reference on the sheet (Drop Down) to let the user choose from a variety of headings. That doesn't look like much of a task.
Thanks Claus for another classic (to me) piece of code.
Regards,
Howard
|