Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing for Comments?

Status
Not open for further replies.

ribhead

Technical User
Jun 2, 2003
384
US
I am trying to write in some code that will put in a comment filled with the date and time when a cell is changed. The problem is the cell can be changed numerous times so how can test for a comment with an If statement? If there is a comment I want to delete it and fill it with anohter comment. It would be nice to add to the original comment but that might be a little more than anyone wants to help me with. Any help would be great!!!

I may not be very smart but I'm sure wirey!!!!
 
You can search here for many threads discussing ways to work with Excel cell comments. Here is one such: thread68-519901

 
This is what I ended up doing. Thanks for the post however. I'm very new so a lot of this I have to keep simple.

Sub whatever()
On Error GoTo ErrorHandler
Range("A1").AddComment "It"
GoTo Line10
ErrorHandler:
Range("A1").Comment.Delete
Range("A1").AddComment "works"
Line10:
End Sub

I may not be very smart but I'm sure wirey!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top