I am trying to set up a macro that will save Notes (comments) that are in a worksheet, and then (after that worksheet is cleared and repopulated) restore those same Notes. This is necessary because the PayrollSheet has a column for each employee ID, and repopulating the sheet inserts new employee IDs, so Notes need to be restored based on the employee ID (which may be in a different column than it was previously).
Unfortunately, when I try to read / save the text for a Note, I get a 1004 runtime error.
Macro code I'm using is:
The error 1004 occurs at the CommentsSheet.Cells(WriteRowC, CommentColC) = c.Comment.Text line. The two previous lines (which use the cell's column and row numbers) work fine, so c is referring to a specific cell (and when stepping through the code manually, it is indeed referring to a cell which has a Note attached).![]()
Please Login or Register to view this content.
Apparently, Comment.Text can be used to SET the text in a comment, but not to READ the text in a comment.
For clarification, I am referring to NOTES (which are called Comments in VBA), not to "COMMENTS" (which are called CommentsThreaded in VBA). Talk about confusing!!!
So, how can I READ (and save) the text in a Note / "Comment"?
Bookmarks