• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy cell data into a comment box of another cell

Amro-2010

New Member
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
 
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
 
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
 
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.
 
Back
Top