How to Link Textbox to Multiple Cells in Excel (4 Easy Ways)

Here’s an overview of a textbox that is linked to a specific cell.

Overview Image


How to Link a Textbox to Multiple Cells in Excel: 4 Easy Ways

We have a dataset of the Sales Report of a company. We will link the total sales in a textbox.

Dataset


Method 1 – Applying the Ampersand Operator

Steps:

=B12&" "&C12

Using Ampersand Operator to link textbox to multiple Cells in Excel

  • Move to the Insert tab, choose Text, and select Text Box.

Inserting Text Box to link in Multiple cells in Excel

  • Draw a textbox into your sheet by clicking and dragging.

Inserted Text Box

  • Select the textbox and go to the formula bar.
  • Insert the following formula and hit Enter.
=$B$13

Link TextBox to Multiple Cells in Excel

The cell is linked to the text box like in the image below.

After Linking the Text Box

  • Do some formatting to give a stylish outlook to the textbox like ours.

Formatted Text Box to link in multiple cells in Excel

Read More: How to Insert Text Box in Excel


Method 2 – Using the CONCATENATE Function

Steps:

  • Move to cell B13 and enter this formula.
=CONCATENATE(B12," ",C12)

Using CONCATENATE function to link textbox to multiple cells in Excel

  • Insert the textbox as we mentioned in Method 1 and link it with this formula.
=$B$13
  • Press Enter and format the textbox.

Link Text Box to Multiple Cells in Excel


Method 3 – Employing VBA Macros to Link Textbox to Multiple Cells

Steps:

  • Navigate to the Developer tab.
  • Choose Insert from the Controls option,
  • Pick Text Box under ActiveX Control.

Inserting Text Box with ActiveX Controls

  • Draw a text box (click on the sheet and drag, then release).

Inserted Textbox

  • Right-click on the sheet name and choose View Code from the Context Menu.

Using Context Menu View Code to link textbox to multiple cells in Excel

  • In the Visual Basic editor, insert the following code.
Sub link_txtbox()
TextBox1.Text = Range("C12").Value
End Sub

The above code will link up the cell value of C12 to the textbox as we entered the command TextBox1.Text = Range(“C12”).Value

VBA code to link textbox to multiple cells in Excel

  • Run the code with the F5 key, and you will find that the cell is linked to the textbox.

Final Output after linking

Read More: How to Align Text Boxes in Excel


Method 4 – Incorporating Data Validation

Steps:

  • Select cell B5 and go to the Data tab, then choose Data Validation from the Data Tools

Incorporating Data Validation Tool

  • The Data Validation window pops out.
  • Select List in the Allow box and insert all student names in the Source. Alternatively, use an array from the table or a named range.
  • Hit OK.

Data Validation Window

  • Insert a textbox in cell B7, as mentioned in Method 1.
  • Use the following formula in the textbox’s formula bar.
=$B$5

The textbox is attached with cell B5.

Link cell to text

If you change the value from the dropdown, the textbox will change accordingly.

GIF to show dynamic textbox

Read More: How to Edit Text Box in Excel


How to Convert a TextBox to a Cell in Excel

  • Insert textboxes to the cell B5:B11 range.

Using Text Box to Multiple cells

  • Navigate to the Developer tab and choose Visual Basic.

Opening Visual Basic Editor

  • From the Visual Basic editor, select the Insert tab and choose Module.

Insert Module

  • Insert the following code in the module that opens.
Sub ConvertTextBoxToCell()
    Dim Sh_xRg As Range
    Dim Sh_xRow As Long
    Dim Sh_xCol As Long
    Dim Sh_xTxtBox As TextBox
    Set Sh_xRg = Application.InputBox("Select a cell):", "Convert Text Box to Cell ", _                    ActiveWindow.RangeSelection.AddressLocal, , , , , 8)
    Sh_xRow = Sh_xRg.Row
    Sh_xCol = Sh_xRg.Column
    For Each Sh_xTxtBox In ActiveSheet.TextBoxes
        Cells(Sh_xRow, Sh_xCol).Value = Sh_xTxtBox.Text
               Sh_xRow = Sh_xRow + 1
    Next
End Sub

VBA code to covert textbox to cell

  • Run the code with the F5 key, and you will find the InputBox for selecting a cell where to start. In our case, it is cell $D$5.
  • Hit OK.

Convert Text Box to Cell dialog Window

The textboxes have been converted into the cell values.


Practice Section

We have provided a practice section on each sheet on the right side for your practice.

Practice Section


Download the Practice Workbook


Related Articles


<< Go Back to TextBox | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Fahim Shahriyar Dipto
Fahim Shahriyar Dipto

Fahim Shahriyar Dipto is a graduate of Mechanical Engineering at BUET. With over 1.5 years of experience at Exceldemy, he authored 70+ articles on ExcelDemy. He has expertise in designing worksheets at You’ve Got This Math. Currently, He is a Team Leader at Brainor. Dipto's passion extends to exploring various aspects of Excel. Beyond tech, he enjoys creating engaging kids' worksheets using Illustrator. A dedicated employee and innovative content developer, He incorporates a commitment to academic excellence and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo