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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: move cell comments to other cell

Status
Not open for further replies.

galorin

MIS
Nov 22, 2007
154
GB
I would like to have a macro or something of that sort that will go through each tab on a spreadsheet, and if a cell has a comment, copy the text of that comment to another location.

So far, the only question I have, is how do I get at the comment in the cell?
 




Check out the Comments Collection. This "moves" the comment one cell to the right...
Code:
Sub test()
    Dim ws As Worksheet, cm As Comment
    For Each ws In Worksheets
      For Each cm In ws.Comments
        With cm
            .Parent.Offset(0, 1).AddComment .Text
            .Delete
        End With
      Next
    Next
End Sub


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top