Sub add_comment() Dim i As Long Dim x As String, found As Range Dim j As Long, k As Long
For i = 2 To Sheets("Clients").Range("a1").End(xlDown).Row Set found = Sheets("Details").Range("a:a").Find(Sheets("Clients").Cells(i, 1).Value, LookIn:=xlValues) If Not found Is Nothing Then j = found.Row x = "" For k = 2 To Sheets("Details").Range("a1").End(xlToRight).Column If Sheets("Details").Cells(j, k).Value <> "" Then x = x & Sheets("Details").Cells(j, k).Value & vbCrLf End If Next k On Error Resume Next Sheets("Clients").Cells(i, 1).Comment.Delete Sheets("Clients").Cells(i, 1).AddComment x End If Next i End Sub On Mon, Dec 17, 2012 at 6:44 PM, Excel_Lover <idforex...@gmail.com> wrote: > Hi All, > > Good Afternoon!!! > > Can Somebody help me by giving a macro which can add comments based on a > cell value like, > In the attached workbook, sheet named 'Clients' I have a list of > client codes against which 'Details' sheet they have some requirements > in columns named 'Req.1' , 'Req.2', 'Req.3' & 'Req.4'. > What I need is When I selected a client code in the 'Clients' Sheet the > list of their requirements should be listed in a comment box like I > inserted on Range A2. > > Appreciate your solutions on this. > > Best Regards > Excel_Lover > > -- > Join official Facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > 2) Don't post a question in the thread of another member. > 3) Don't post questions regarding breaking or bypassing any security > measure. > 4) Acknowledge the responses you receive, good or bad. > 5) Jobs posting is not allowed. > 6) Sharing copyrighted material and their links is not allowed. > > NOTE : Don't ever post confidential data in a workbook. Forum owners and > members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To post to this group, send email to excel-macros@googlegroups.com. > To unsubscribe from this group, send email to > excel-macros+unsubscr...@googlegroups.com. > Visit this group at http://groups.google.com/group/excel-macros?hl=en. > > > -- *Regards* * * *Ashish Koul* *Visit* *http://www.excelvbamacros.com/* *http://www.accessvbamacros.com/* P Before printing, think about the environment. -- Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en.