View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Coping cell comments to another cell

If that it the case, here is my macro modified to copy all comments on all
sheets over to the next cell provided that cell has nothing in it...

Sub ShowCommentsNextCell()
Dim C As Comment
Dim WS As Worksheet
Application.ScreenUpdating = False
For Each WS In Worksheets
If WS.Comments.Count 0 Then
For Each C In WS.Comments
With C.Parent.Offset(, 1)
If .Value = "" Then .Value = C.Text
End With
Next
End If
Next
Application.ScreenUpdating = True
End Sub

--
Rick (MVP - Excel)


"brian the great" wrote in message
...
On Dec 26, 12:26 pm, "Rick Rothstein"
wrote:
Give this macro a try; it is a little more compact than the one posted on
Debra's website and it operates slightly differently also (no error
checking
is required with it)...

Sub ShowCommentsNextCell()
Dim C As Comment
If ActiveSheet.Comments.Count 0 Then
Application.ScreenUpdating = False
For Each C In ActiveSheet.Comments
With C.Parent.Offset(, 1)
If .Value = "" Then .Value = C.Text
End With
Next
Application.ScreenUpdating = True
End If
End Sub

By the way, you should always copy/paste code from newsgroups and/or
websites rather than typing them into the VB code windows (as your
original
post indicated you did).

--
Rick (MVP - Excel)

"Still Learning" <Still wrote in
...



No it is not. I'm assuming that the macro doesn't need anything typed
into
it (ie ranges (a1:b4) or sheet names or anythng).


Thanks for trying to help.


PS, is there somewhere that lists what these comands do? (as I said, I'm
still learning)


"Joshua Fandango" wrote:


Community Message Not Available- Hide quoted text -


- Show quoted text -


I think the problem with the original macro was that it only picks up
comments on the current page. so if you apply the macro to a command
button, it will only scan the current worksheet for comments in which
the command button that executed the macro resides. If there are no
comments posted on the current worksheet, the dialogue box will return
"no comments found" even thought there could be several in the
remainder of the workbook.

Try manipulating the language so that it applies to the entire
workbook when executing so that it doesnt just scan an indidual sheet.

hopefully that helps, if not, disregard.