insert multiple comments into single cell in sheet 2 from multiple cells in sheet 1


how do I add /insert multiple comments into single cell in sheet 2 from multiple cells in sheet 1

Sheet 1

1                   wash floor
1                   wash car
2                   pay bills
2                   buy groceries
2                   do charity
3                   bring kids to school

into sheet 2 (as attached)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rutgermonsAuthor Commented:
Martin LissOlder than dirtCommented:
I've attached a workbook that contains an InsertComment macro that you can use to do what you requested. Using the macro I created a comment in cell A8.
Martin LissOlder than dirtCommented:
To assign a shortcut key to the macro, press Alt+F8 to open the "Macro" dialog window. Select the macro, click ‘Options…’,  hold down the Shift key and type the letter C (or any other letter) and click ‘OK’. Then anytime you want to run the macro press Ctrl+Shift+C.
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

rutgermonsAuthor Commented:

can u allow the comments into the comments list box of each project on sheet 2 and not in sheet 1 A8?>

Martin LissOlder than dirtCommented:
I'm not sure what you mean but try the InsertComment2 macro in this workbook. Note that the new macro temporarily puts some data in column C of sheet1 and then clears that column when the macro is done.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
rutgermonsAuthor Commented:

I did notice that the comments write to sheet 2 in column A  which is good but if I change the project sort order in column A i.e.





 for example, then the matching comments don't adopt to that sort order , this is incorrect

can you assist here pls? (happy to setup a new ticket for this)

Martin LissOlder than dirtCommented:
No need.
Sub InsertComment2()

    Dim strComment As String
    Dim lngRowC As Long
    Dim lngRowA As Long
    Dim rngFound As Range
    Application.ScreenUpdating = False
    Sheets("Sheet1").Range("A2:A65536").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheets("Sheet1").Range("C1"), Unique:=True
    With Sheets("Sheet1")
        For lngRowC = 2 To .Range("C1048576").End(xlUp).Row
            strComment = ""
            For lngRowA = 2 To .Range("A1048576").End(xlUp).Row
                If .Cells(lngRowA, "A") = .Cells(lngRowC, "C") Then
                    strComment = strComment & .Cells(lngRowA, "B") & ", "
                End If
            With Sheets("Sheet2").Columns("A")
                Set rngFound = .Find(Sheets("Sheet1").Cells(lngRowC, "C"), LookIn:=xlValues, LookAt:=xlWhole)
                If Not rngFound Is Nothing Then
                    .Cells(rngFound.Row).Comment.Visible = False
                    .Cells(rngFound.Row).Comment.Text Text:=Environ$("UserName") & ":" & Chr(10) & Left$(strComment, Len(strComment) - 2)
                End If
            End With
        .Cells(1, "C").EntireColumn.Clear
    End With
    Application.ScreenUpdating = True
End Sub

Open in new window

rutgermonsAuthor Commented:
thank you so much! this rocks :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.