Hi Guys
I have a problem.
I have a sheet with some case data and use Column I to enter updates. I have a UserForm pops ups on when any cell under range (i2:i200) is clicked, the code is below. The contents of the cell is automatically copied into the text box. I then have a command button which when clicked copies the contents of the text box back into the active cell. I do have Multiline enabled on the text box.
Imagine the cell already contains the below text which would be copied on the text box.
12.05.16 - Contacted the customer and
advised appointment is booked.
In order to enter an update say on the 13.05.2016 I would have to hold CTRL and press enter to line break then manually enter the date and my update.
What I would like is for two automatic line breaks to be added from the last letter in the text box (in the above example it would be the bullet point) and automatically insert today's date in bold e.g. 13.05.16 -
The idea is that I just type in my update and click the button to insert text box value into cell. The code will hopefully make sense of it all.
Worksheet Code
UserForm Code
Command Button
I have a problem.
I have a sheet with some case data and use Column I to enter updates. I have a UserForm pops ups on when any cell under range (i2:i200) is clicked, the code is below. The contents of the cell is automatically copied into the text box. I then have a command button which when clicked copies the contents of the text box back into the active cell. I do have Multiline enabled on the text box.
Imagine the cell already contains the below text which would be copied on the text box.
12.05.16 - Contacted the customer and
advised appointment is booked.
In order to enter an update say on the 13.05.2016 I would have to hold CTRL and press enter to line break then manually enter the date and my update.
What I would like is for two automatic line breaks to be added from the last letter in the text box (in the above example it would be the bullet point) and automatically insert today's date in bold e.g. 13.05.16 -
The idea is that I just type in my update and click the button to insert text box value into cell. The code will hopefully make sense of it all.
Worksheet Code
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Range("i2:i200")) Is Nothing Then
UserForm1.Show
End If
End Sub
UserForm Code
Code:
Private Sub Userform_Activate()
TextBox1.MultiLine = True
TextBox1.Value = ActiveCell.Value
End Sub
Command Button
Code:
Private Sub cmdupdate_Click()
TextValue = TextBox1.Text
ActiveCell.Value = TextValue
Unload Me
End Sub