Inserting Comments en mass

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working with Excel 2003

I have a spreadsheet with a list of Employee Names in column A, and a list
of Employee Numbers in column B.

I would like to be able to move all of the Employee Numbers into comments
for the coresponding Employee name. Is there a way to cut/paste/insert and do
this? I tried copying and then pasting special using the Comments option, but
it didn't do what I want...

This seems like it would be a very basic and usable function, does it exist?
 
Hi Heather

Here's a bit of code to do it:

Sub NumberToComments()

Dim r As Range

Application.ScreenUpdating = False

For Each r In Columns(1).SpecialCells(xlCellTypeConstants, xlTextValues)
r.AddComment
r.Comment.Text Text:=CStr(r.Offset(, 1).Text)
Next

Application.ScreenUpdating = True

End Sub
 
I'm sorry! I'm confused. Is that HTML, or something I should copy/paste into
the cell like regular excel codes?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top