Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / May 2008

Tip: Looking for answers? Try searching our database.

Converting comments to data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
glarosa - 28 May 2008 05:43 GMT
Hi There,

I have a basic spreadsheet set up and in one particular column, each cell
has a comment attached. Is there some way that I create a new column and copy
each of those comments into the cells so that they become part of the data in
the spreadsheet? I don't want to cut and paste each individually as there are
hundreds of cells but do them on one go. Is this possible?

Thanks in advance for your help.

Signature

Cheers

GLR

Tim - 28 May 2008 08:36 GMT
Here is a very nice sample workbook:
http://www.contextures.on.ca/CommentsNumberPrint.zip

Tim

> Hi There,
>
[quoted text clipped - 5 lines]
>
> Thanks in advance for your help.
glarosa - 28 May 2008 13:09 GMT
Thanks for your help Tim, but although I could open the spreadsheet, it would
not activate the macro because of the security level. Hence I could not gte
the thing to work.
Signature

Cheers

GLR

> Here is a very nice sample workbook:
> http://www.contextures.on.ca/CommentsNumberPrint.zip
[quoted text clipped - 10 lines]
> >
> > Thanks in advance for your help.
Mike H - 28 May 2008 08:43 GMT
Hi,

Right click your sheet tab, view code and paste this in. Currently it uses
Column A so change to suit. It will copy comments into the cell to the right
of the column you use and then delete th original comment.

Sub marine()
Application.ScreenUpdating = False
Set myrange = Range("A1:a100")
For Each c In myrange
   On Error Resume Next
   c.Offset(, 1).Value = c.Comment.Text
   c.ClearComments
Next
   Application.ScreenUpdating = True
End Sub

Mike

> Hi There,
>
[quoted text clipped - 5 lines]
>
> Thanks in advance for your help.
glarosa - 28 May 2008 13:06 GMT
Thanks Mike. I did as you said but I can't seem to get back to the worksheet
and activate the code. Sorry but I'm a very basic user. Can you explain
further?

Many Thanks
Signature

Cheers

GLR

> Hi,
>
[quoted text clipped - 24 lines]
> >
> > Thanks in advance for your help.
Tim - 29 May 2008 11:25 GMT
Hi,

First change your security level-Tools>Options>Security>Macro
Security>Choose the “Low” option.

Then Copy this code:

Sub showcomments()
'posted by Dave Peterson 2003-05-16
   Application.ScreenUpdating = False

   Dim commrange As Range
   Dim cmt As Comment
   Dim curwks As Worksheet
   Dim newwks As Worksheet
   Dim i As Long

   Set curwks = ActiveSheet

   On Error Resume Next
   Set commrange = curwks.Cells _
       .SpecialCells(xlCellTypeComments)
   On Error GoTo 0

   If commrange Is Nothing Then
      MsgBox "no comments found"
      Exit Sub
   End If

   Set newwks = Worksheets.Add

    newwks.Range("A1:D1").Value = _
        Array("Number", "Name", "Value", "Comment")

   i = 1
   For Each cmt In curwks.Comments
      With newwks
        i = i + 1
        On Error Resume Next
        .Cells(i, 1).Value = i - 1
        .Cells(i, 2).Value = cmt.Parent.Name.Name
        .Cells(i, 3).Value = cmt.Parent.Value
        .Cells(i, 4).Value = cmt.Parent.Address
        .Cells(i, 5).Value = Replace(cmt.Text, Chr(10), " ")
      End With
   Next cmt

   newwks.Cells.WrapText = False
   newwks.Columns.AutoFit

   Application.ScreenUpdating = True

End Sub

Go to your workbook>Alt+F11>Insert>Module and Paste the copied Code.
Close the VBA Editor>Select your worksheet with the comments>Alt+F8> and
Run the macro “showcomments”.
After running the macro it will list all comments from your worksheet
regardless in which column are they on a new Worksheet. If you have comments
in more the one column and you insist to list only the comments from that
particular column then use the Mike’s suggestion.
Hope this helps.

Tim

> Thanks Mike. I did as you said but I can't seem to get back to the worksheet
> and activate the code. Sorry but I'm a very basic user. Can you explain
> further?
>
> Many Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.