UserForm textbox to textbox in sheet

KlaasE

New Member
Joined
Nov 4, 2019
Messages
37
Hello there,

I'm pretty new with VBA and I am trying to make a Userform to add comments to an excel sheet.
I have a combo box with initials (of the person making the comment) and a text box where they will write the comment.
Now if the person clicks the OK button I want it to start a new line with Initials, the date, and the comment.
For instance:

04-11-2019 - EL: Order has been moved to Friday.
05-11-2019 - SK: Order is done.

Any help is appreciated.
Thanks in advance!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi & welcome to MrExcel.
How about something like
Code:
Private Sub CommandButton1_Click()
    Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Format(Date, "dd-mm-yyyy") & " - " & Me.ComboBox1.Value & ": " & Me.TextBox1.Value
End Sub
 
Upvote 0
Hi there Fluff,

Thanks for the quick reply!
It does everything perfectly, except it puts the comments in a cell. Is there a way to make them appear in a text box?
 
Upvote 0
In your op you said to add the comments to an Excel sheet.
So what is the textbox name & where is it?
 
Upvote 0
Ok, how about
Code:
    Sheets("sheet1").CommentBox = Format(Date, "dd-mm-yyyy") & " - " & Me.ComboBox1.Value & ": " & Me.TextBox1.Value
 
Upvote 0
With above code I receive the following error: This property or method is not supported by this object.
 
Upvote 0
Is it an ActiveX or Forms Control Textbox?
 
Upvote 0
It was indeed a Forms Control Textbox. I switch it with an ActiveX Textbox and it works.

Thank you for your help!
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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