A Amro-2010 New Member Feb 11, 2010 #1 Hi, i need to copy range of cells data to another range of cells comments boxes. any idea ? for example, B1:B10 have data needed to appears as a comments on A1:A10
Hi, i need to copy range of cells data to another range of cells comments boxes. any idea ? for example, B1:B10 have data needed to appears as a comments on A1:A10
Hui Excel Ninja Staff member Feb 11, 2010 #2 Amro try the following macro Set the Column and Row offsets in the macro Make sure the destination cells have no comments Select the Range of data which you want to copy to the Offset Cells Comments Run the Macro RangetoComments Sub RangetoComments() RowOffset = 0 ColumnOffset = -1 For Each c In Selection If c.Value <> "" Then Cells(c.Row + RowOffset, c.Column + ColumnOffset).AddComment.Text c.Text End If Next End Sub
Amro try the following macro Set the Column and Row offsets in the macro Make sure the destination cells have no comments Select the Range of data which you want to copy to the Offset Cells Comments Run the Macro RangetoComments Sub RangetoComments() RowOffset = 0 ColumnOffset = -1 For Each c In Selection If c.Value <> "" Then Cells(c.Row + RowOffset, c.Column + ColumnOffset).AddComment.Text c.Text End If Next End Sub
A Amro-2010 New Member Feb 14, 2010 #3 Hello Hui, the macro you have posted worked perfectly, thanks a lot. i'm totally new with macro stuff so any advice to learn more and be able to create my own macros ? Regards, Amro
Hello Hui, the macro you have posted worked perfectly, thanks a lot. i'm totally new with macro stuff so any advice to learn more and be able to create my own macros ? Regards, Amro
Hui Excel Ninja Staff member Feb 14, 2010 #4 The best advice is 3 points 1. Experiment, in small steps Record macros that do small bits and analyse the results and add them to your projects a little bit at a time. 2. Read, there are plenty of Books and on-line reading about macro's, once again just do little bits at a time. 3. Save. Save your projects regularly, as you can totally corrupt your data with a misconstrued macro.
The best advice is 3 points 1. Experiment, in small steps Record macros that do small bits and analyse the results and add them to your projects a little bit at a time. 2. Read, there are plenty of Books and on-line reading about macro's, once again just do little bits at a time. 3. Save. Save your projects regularly, as you can totally corrupt your data with a misconstrued macro.