View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
AllenWatts AllenWatts is offline
external usenet poster
 
Posts: 1
Default Macro to Add Comments with vlookup


I have an array of data on one sheet, and another sheet with definitions
for each unique record in the array.

I'd like to have Excel automatically look up the definition for each
record and place it in a comment on that cell. This way, the end user
just hovers over each cell and gets the definition for the value in the
cell.

I assume this must be done with a macro, but I have no experience with
macros. Here's my first stab at it (which doesn't work). Could someone
point me in the right direction?

Sub AutoComment()

Dim CommentValue


Set CommentValue = VLOOKUP(ActiveCell,SkillLegend!A:B,2,FALSE)


With B4: H27
If .Comment Is Nothing Then .AddComment
..Comment.Text Text:=CommentValue
End With
End Sub

Thank you!


--
AllenWatts
------------------------------------------------------------------------
AllenWatts's Profile: http://www.excelforum.com/member.php...o&userid=34301
View this thread: http://www.excelforum.com/showthread...hreadid=540704