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

Copying comments to cells

Status
Not open for further replies.

Pandab2002

IS-IT--Management
Apr 16, 2003
47
US
I have a simple spreadsheet that is a site directory. It has various telephone numbers and IP addresses entered as comments. There are a couple hundred of them. Is there a way to quickly copy all these comments into cells?

Any help would be appreciated.
 
Hi,

No way with native Excel functionality.

However, here's some code that you might be able to use. Copy and paste in a module in the VB Editor (alt+F11 toggles between VB Editor and Sheet)

If you have further VBA Code questions, pleas post in Forum707.
Code:
Sub Coments2Sheet()
'SkipVought - [URL unfurl="true"]www.Tek-Tips.com[/URL]
'2007 Jun 16
'transfers comments to assiciated cell in the active sheet.
    Dim cmt As Comment, r As Range
    For Each r In ActiveSheet.UsedRange
        For Each cmt In ActiveSheet.Comments
            If r.Address = cmt.Parent.Address Then
                r.Value = cmt.Text
                Exit For
            End If
        Next
    Next
End Sub

Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top