rsen1
asked on
Link textbox1 to Range "D3"
Hi guys, how can I link data in textbox 1 to Range("D3")
Thank you
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If the text in the textbox will always start with "Name: " (that's Name: followed by a space) then
In VBA do this
Private Sub TextBox1_Change()
Range("D3").Value = Split(TextBox1.Text, ": ")(1)
End Sub
In VBA do this
Private Sub TextBox1_Change()
Range("D3").Value = Split(TextBox1.Text, ": ")(1)
End Sub
In the workbook it's an ActiveX textbox, not a Forms texbox, so what's been posted won't work.
What exactly do you want to appear where and when?
If you want the value typed in D3 to appear in the textbox you can set the textbox's LinkedCell property to D3.
That will only put what's in D3 in the textbox, it won't add any sort of prefix.
What exactly do you want to appear where and when?
If you want the value typed in D3 to appear in the textbox you can set the textbox's LinkedCell property to D3.
That will only put what's in D3 in the textbox, it won't add any sort of prefix.
I believe he wants the name that's typed in the textbox to appear in D3. eg if "Name: Marty" is in the textbox then D3 should be 'Marty'.
ASKER
Guys, thank you very much for you suggestions, they were a great help.
The code that worked for me
Private Sub CommandButton1_Click()
Range("H10").Value = TextBox1.Text
End Sub
The code that worked for me
Private Sub CommandButton1_Click()
Range("H10").Value = TextBox1.Text
End Sub
So since we helped are you going to assign points?
ASKER
The points were assigned yesterday, I split them
Thanks, and my apologies, I didn't notice.
ASKER
Maybe I asked the question wrong, please see attached. I need the range D3 to equal the contents of the textbox
textbox.xlsx