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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

EvilPanda

New Member
Joined
Nov 1, 2010
Messages
37
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..
 

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
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:

Forum statistics

Threads
1,181,695
Messages
5,931,498
Members
436,790
Latest member
aelbaitam

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
Top