ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding Cell Comments from TextBox entry (https://www.excelbanter.com/excel-programming/351245-adding-cell-comments-textbox-entry.html)

excelnut1954

Adding Cell Comments from TextBox entry
 
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.


JakeyC

Adding Cell Comments from TextBox entry
 
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)


Tom Ogilvy

Adding Cell Comments from TextBox entry
 
Range("Cellcomment").NoteText Text:=Textbox7.Text

is the easy way.



--
Regards,
Tom Ogilvy

"excelnut1954" wrote in message
ups.com...
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.




excelnut1954

Adding Cell Comments from TextBox entry
 
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.


Tom Ogilvy

Adding Cell Comments from TextBox entry
 
My method is an older method. The nice thing about it is it works even if a
comment already exists.

--
Regards,
Tom Ogilvy


"excelnut1954" wrote in message
oups.com...
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.





All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com