Praedico
New Member
- Joined
- Jul 17, 2008
- Messages
- 43
I have an Excel 2003 spreadsheet on Win XP with a column of data. 635 rows plus the header. Some of the cells have comments, some don't.
I'd like to overwrite the data in the cell with the data in the comment (if the cell has one).
I don't really want to do this manually 635 times.
So far I have a macro with the following but it's not working:
I believe the issue is with the "comment.text" portion of the if statement and when it encounters a cell without a comment.
Any help is much appreciated
Thank you
I'd like to overwrite the data in the cell with the data in the comment (if the cell has one).
I don't really want to do this manually 635 times.
So far I have a macro with the following but it's not working:
Code:
Sub Macro1()
Dim r As Integer
Dim rmax as Integer
r = 2
rmax = 636
For r = 2 To rmax
If Sheet2.Range("a" & r).Comment.Text <> "" Then
Range("a" & r).Value = Range("g" & r).Comment.Text
End If
Next r
End Sub
I believe the issue is with the "comment.text" portion of the if statement and when it encounters a cell without a comment.
Any help is much appreciated
Thank you