VBA & Macro Problems

Link Excel VBA UserForm Text Boxes to Worksheet Cells

Olivia MillerOlivia Miller Nov 12, 2026 868 views

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.

Link Excel VBA UserForm Text Boxes to Worksheet Cells
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the UserForm in the VBA Editor

In Excel, press Alt+F11, expand your workbook in Project Explorer, and double-click the UserForm that contains TextBox1, TextBox2, and TextBox3.

2
Link the first display text box

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.

3
Link and disable the second display text box

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.

4
Link the editable text box

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.

5
Run and test the form

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.

Bind each UserForm text box by using the ControlSource property
Two-way cell link enabled: With TextBox3 enabled and linked through ControlSource, users can edit the worksheet value directly from the UserForm.
WPS Spreadsheet VBA

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. 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. 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. 3. Set the cell links: Enter the appropriate worksheet cell reference or named range in each text box ControlSource property.
  4. 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.
Link VBA UserForm text boxes to worksheet values for display and data entry.Set display fields to disabled while keeping input fields editable.Open and work with Microsoft Excel .xlsx, .xls, and .xlsm workbook formats.Use a familiar spreadsheet interface for workbook and macro tasks.
QA img-9

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.