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

folks

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

Sheet 1

PROJECT         COMMENTS
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)
rutgermonsAsked:
Who is Participating?

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

x
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.
28694819.xlsm
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:
martin

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

cheers
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.
28694819a.xlsm

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:
Martin

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.

from  

1
2
3

to

3
1
2

 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)

cheers
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
            Next
            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).ClearComments
                    .Cells(rngFound.Row).AddComment
                    .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
        Next
        .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.