Link Excel VBA UserForm Text Boxes to Worksheet Cells
Question details
Set up three VBA UserForm text boxes so two show values from worksheet cells and one lets the user enter or edit a value in a worksheet cell.

- Product
- Microsoft Excel VBA UserForm
- Device & OS
- not provided
- Scenario
- The user wants a UserForm to display existing worksheet data in two text boxes and save user-entered data from a third text box to a worksheet.
- Observed behavior
- TextBox1 and TextBox2 should be display-only controls, while TextBox3 should remain editable and update its linked worksheet cell.
Identify the worksheet cells or named ranges that each text box should use before configuring the UserForm. Keep the source workbook open when testing because ControlSource links update the active workbook data.
Bind each UserForm text box by using the ControlSource property
Use this method when the text box values should stay directly linked to worksheet cells without writing separate code for each control.
The ControlSource property creates a link between a UserForm control and a worksheet cell. Display-only text boxes can be disabled, while an editable text box can write changes back to its linked cell.
In Excel, press Alt+F11, expand your workbook in Project Explorer, and double-click the UserForm that contains TextBox1, TextBox2, and TextBox3.
Select TextBox1, press F4 to open the Properties window, and set ControlSource to the required worksheet reference, such as Sheet1!A1 or a workbook-level named range.
Select TextBox2, set its ControlSource property to its display cell, such as Sheet1!B1, then set Enabled to False if users should not edit the displayed value.
Select TextBox3, set ControlSource to the destination cell, such as Sheet1!C1, and leave Enabled set to True so users can type or edit the linked value.
Press F5 while the UserForm is active, or run the procedure that shows the form. Confirm that TextBox1 and TextBox2 display cell values and that changes in TextBox3 update its linked worksheet cell.

Use named ranges for more reliable ControlSource links
Use this option when worksheet names may change or when you want ControlSource settings that are easier to read and maintain.
Create worksheet-linked VBA UserForm text boxes in WPS Spreadsheet
Use WPS Spreadsheet VBA tools to build a UserForm, link text boxes to worksheet cells through ControlSource, and keep selected controls read-only while allowing data entry in an editable field.
- 1. Open the VBA development tools: Open the workbook in WPS Spreadsheet and use the Developer or Macro tools to access the VBA editor and your UserForm project.
- 2. Select the display text boxes: In the UserForm designer, select the text boxes that should show existing worksheet values and open their Properties panel.
- 3. Set the cell links: Enter the appropriate worksheet cell reference or named range in each text box ControlSource property.
- 4. Control which fields users can edit: Set Enabled to False for display-only text boxes and leave Enabled enabled for the text box that accepts worksheet input.

Frequently Asked Questions
What does the ControlSource property do for a VBA UserForm text box?
ControlSource links a text box to a worksheet cell or named range. The control displays the linked value, and an enabled text box can write edits back to that location.
How can I prevent users from changing a displayed value in a UserForm?
Select the display text box in the UserForm designer, open the Properties window with F4, and set Enabled to False. Its ControlSource can remain linked to the worksheet cell.
Should I use a cell address or a named range in ControlSource?
Both can work, but a workbook-level named range is often easier to maintain. Create it through Formulas > Define Name, then enter that name in the text box ControlSource property.
Why does my editable text box not update the worksheet cell?
Check that the text box has a valid ControlSource reference, that Enabled is set to True, and that the linked worksheet or named range exists in the workbook containing the UserForm.




