View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Otto Moehrbach[_6_] Otto Moehrbach[_6_] is offline
external usenet poster
 
Posts: 201
Default Adding Comment to cell

Troy
You can use the following to look at each cell in YourRange.
Dim i As Range
For Each i In YourRange
'What you want to do
Next i

Within this loop you can use the following to determine if that cell has a
comment:
If i.Comment Is Nothing Then.............
The argument in the above If statement is True if the cell has no
comment.
You can get the opposite with:
If Not i.Comment Is Nothing Then...............

Still within the same loop, you can then use an InputBox statement to
type in the comment you want, like:
MyComment=InputBox................

Then the following statement will put that comment in that cell.
i.AddComment text:=MyComment

I purposely didn't put all the above together nice and neat for
you because you seemed interested in learning. This will give you something
to chew on for a while. Post back if you need more. HTH Otto


"Troy H" wrote in message
...
I have dabbled in programming and have checked out what other have sent,

but I am still having problems getting all of it to work. Here is my
problem.

I have a range of cell, B6, D6, F6, H,6, J6, L6, N6, P6 which I have made

into a range. (This range will most likely be extended to cover rows 6-41 if
possible) I would like to be able to create a macro that check the active
cell within that range and see if a comment exitsts, if it does not, then
pop open a textbox for adding a comment.

I have a macro that works on a specified cell but not from a range. I know

this is over my head but this is how we learn, is it not? Any help will
always be much appreciated.