Adding Cell Comments from TextBox entry

E

excelnut1954

Here is one I can't find any info on. In a UserForm, the user has the
option of entering text in TextBox7 to be entered as Cell Comments.
Let's say that this text would be entered to the named range
"CellComment".

Anybody know how this would be done?

Thanks,
J.O.
 
J

JakeyC

If your textbox is named "TextBox1" and is on "UserForm1", and you wish
the contents to be used as a comment in cell B5 then use the code:

Range("B5").AddComment (TextBox1.Value)
 
E

excelnut1954

Thanks Tom. Works real well. Learned alot today. Especially since this
isn't my main job. I appreciate your simplicity, and your time.

Thanks JakeyC. The 2 lines of code seem to do the same thing, yet
they are different. A couple years, and I may learn enough to know why.

Thanks guys
J.O.
 
T

Tom Ogilvy

My method is an older method. The nice thing about it is it works even if a
comment already exists.
 

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

Top