Add comment using textbox2 value as its text..

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Looking to add comment using textbox2 value as comment and textbox1 value/text be added to range A1. however it is not working so far....

Please suggest:

Private Sub CommandButton1_Click()
Range("A1").Value = TextBox1.Value
With Range("A1")
.AddComment.Text Text:=Application.UserName & Chr(10) & TextBox2.Text & Chr(10) & ":)"
End With
End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Looking to add comment using textbox2 value as comment and textbox1 value/text be added to range A1. however it is not working so far.


As far as I know, you need:

Code:
With Range("A1")
  .AddComment(Application.UserName & Chr(10) & TextBox2.Text & Chr(10) & ":)")
End With

But that might not be everything..
 
Upvote 0
Now it work...but rather long one for me did rearrange it...:)

Thanks
Code:
With Sheet1
Range("A1").Value = TextBox1.Value
Range("A1").Select
Range("A1").Comment.Delete
Range("A1").AddComment
Range("A1").Comment.Visible = False
Range("A1").Comment.Text Text:=Application.UserName & Chr(10) & TextBox2.Text & Chr(10) & "" & Chr(10) & ":)"
Range("A1").Select
Range("A1").Comment.Visible = True
End With
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,526
Messages
6,114,122
Members
448,550
Latest member
CAT RG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top