Link to home
Start Free TrialLog in
Avatar of rsen1
rsen1

asked on

Link textbox1 to Range "D3"

Hi guys, how can I link data in textbox 1 to Range("D3")

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rsen1
rsen1

ASKER

Thank you for your response,

Maybe I asked the question wrong, please see attached. I need the range D3 to equal the contents of the textbox
textbox.xlsx
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 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.
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'.
Avatar of rsen1

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
So since we helped are you going to assign points?
Avatar of rsen1

ASKER

The points were assigned yesterday, I split them
Thanks, and my apologies, I didn't notice.