Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Coping cell comments to another cell
I have been trying to use this macro:
http://www.contextures.com/xlcomment...l#CopyAdjacent to copy comments into a different cell. I have seen numerious links to this same macro, but I can't get it to work. I type it into VB just as it is written, but when I run the macro, I always get the dialog box that says "no comments found", even though there are comments. Any ideas what I'm doing wrong? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Coping cell comments to another cell
Hi SL,
Works fine for me. Are you sure the cells to the right of the ones containing the comments are blank? If you take out the lines: If mycell.Offset(0, 1).Value = "" Then & End If It should overwrite anything found in the cells to the right - any use to you? HtH, JF On 25 Dec, 10:17, Still Learning wrote: I have been trying to use this macro:http://www.contextures.com/xlcomment...l#CopyAdjacent to copy comments into a different cell. *I have seen numerious links to this same macro, but I can't get it to work. *I type it into VB just as it is written, but when I run the macro, I always get the dialog box that says "no comments found", even though there are comments. *Any ideas what I'm doing wrong? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Coping cell comments to another cell
Okay, I took out the lines you said. I still get the no comments found msg.
Here is what I'm doing to test this; I highlight the cell that has a comment (with the little red triangle) and select run macro. That's when I get the msg. I've also tried running the macro on the sheet, it did the same, that's why I tried just the one cell. I very new to programming in VB. I would really like to get this to work. "Joshua Fandango" wrote: Hi SL, Works fine for me. Are you sure the cells to the right of the ones containing the comments are blank? If you take out the lines: If mycell.Offset(0, 1).Value = "" Then & End If It should overwrite anything found in the cells to the right - any use to you? HtH, JF On 25 Dec, 10:17, Still Learning wrote: I have been trying to use this macro:http://www.contextures.com/xlcomment...l#CopyAdjacent to copy comments into a different cell. I have seen numerious links to this same macro, but I can't get it to work. I type it into VB just as it is written, but when I run the macro, I always get the dialog box that says "no comments found", even though there are comments. Any ideas what I'm doing wrong? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Coping cell comments to another cell
Is the worksheet protected?
On 25 Dec, 11:05, Still Learning wrote: Okay, I took out the lines you said. *I still get the no comments found msg. Here is what I'm doing to test this; I highlight the cell that has a comment (with the little red triangle) and select run macro. *That's when I get the msg. I've also tried running the macro on the sheet, it did the same, that's why I tried just the one cell. I very new to programming in VB. *I would really like to get this to work. "Joshua Fandango" wrote: Hi SL, Works fine for me. Are you sure the cells to the right of the ones containing the comments are blank? If you take out the lines: If mycell.Offset(0, 1).Value = "" Then & End If It should overwrite anything found in the cells to the right - any use to you? HtH, JF On 25 Dec, 10:17, Still Learning wrote: I have been trying to use this macro:http://www.contextures.com/xlcomment...l#CopyAdjacent to copy comments into a different cell. *I have seen numerious links to this same macro, but I can't get it to work. *I type it into VB just as it is written, but when I run the macro, I always get the dialog box that says "no comments found", even though there are comments. *Any ideas what I'm doing wrong?- Hide quoted text - - Show quoted text - |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Coping cell comments to another cell
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Coping cell comments to another cell
Hi SL,
You're right, there's no need to specify a range to act on as the code works on every cell in the active worksheet with a comment in it (or it is supposed too!) See if the following will work; you need to highlight the cells containing comments before running it. Sub Comment_Text_In_Cell_To_Right() Dim Cell As Object On Error Resume Next For Each Cell In Selection If Cell.Comment = True Then Cell.Offset(0, 1) = Cell.Comment.Text End If Next Cell On Error GoTo 0 End Sub On 25 Dec, 11:35, Still Learning <Still wrote: 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 - |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Coping cell comments to another cell
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 message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
coping of cell using dragging the cell downward or rightward | Excel Discussion (Misc queries) | |||
Coping part of a cell content into a seperate cell | Excel Discussion (Misc queries) | |||
Coping a Coloured cell | Excel Worksheet Functions | |||
coping formulas from one cell to another | Setting up and Configuration of Excel | |||
Coping Values - Not the cell | Excel Programming |