Linking Cell value to the value in a text Box

behrensf84

New Member
Joined
Dec 31, 2014
Messages
9
Hi, does anyone know how to link a cell value to what is typed in to a text box? what I need is to be able to type into a text box, and then have the cell value update automatically. thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I don't know that there is a way to do it with the "standard" text box that you use from the "Insert" menu, but you can insert a textbox ActiveX object from the Developer tab, then tie the updated textbox to a cell and do it that way.

Here is some code that updates cell A1 with whatever you place in TextBox1.

Code:
Sub TextBox1_LostFocus()Dim sValue As String


sValue = Sheets("Sheet1").TextBox1.Value


With Sheets("Sheet1")
    .Cells(1, 1).Value = sValue
End With


End Sub
 
Upvote 0
Also with the ActiveX version of a TextBox
You can right click the textbox and choose Properties, and set the 'LinkedCell' property of that textbox to a range.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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