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

A textbox is a portable tool that is used to cover important text or information in Excel. You can drag the text box anywhere in the sheet. Also, it is possible to link a cell to the textbox. But you cannot link multiple cells in a textbox. To do this, you need to join the cells initially with Excel’s built-in function. Then you need to add the link to a textbox. In this article, we are going to show you some simple and straightforward ways to link textbox to multiple cells in Excel. So, let’s get started.

Overview Image


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

To link multiple cells to a textbox in Excel, you need to create a dataset first. Here, we have taken a dataset of the Sales Report of ABC Company. We will link the total sales in a textbox here.

Dataset

Not to mention, we have used Microsoft 365 version. You may use any other version at your convenience.


1. Applying Ampersand Operator

While linking with multiple cells, you need to insert the Ampersand (&) operator. It joins two or more cells together. Then, you need to link the cells to a textbox. Follow the steps to do that.

📌 Steps:

  • Initially, calculate the Total Sales. Then link the two cells in cell B13 with the below formula.
=B12&" "&C12

Using Ampersand Operator to link textbox to multiple Cells in Excel

  • Apparently, move to the Insert tab >> Text >> Text Box.

Inserting Text Box to link in Multiple cells in Excel

  • Eventually, a textbox has been created like the image below.

Inserted Text Box

  • Consequently, select the textbox and go to the formula bar to link the desired cells.
  • Additionally, insert the below formula.
=$B$13
  • After that, press ENTER.

Link TextBox to Multiple Cells in Excel

Finally, the cells are linked to the text box like in the image below.

After Linking the Text Box

Moreover, 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


2. Using the CONCATENATE Function

We may join two or more cells with the CONCATENATE function. It joins the cells, and then you need to link the multiple joined cells to the textbox. We have demonstrated the steps for better visualization.

📌 Steps:

  • Firstly, move to cell B13 and enter the formula.
=CONCATENATE(B12," ",C12)

Using CONCATENATE function to link textbox to multiple cells in Excel

  • Subsequently, insert the textbox as we mentioned in Method 1 and link it with the below formula.
=$B$13
  • Sequentially, press ENTER and format the textbox. The final output is like the image below.

Link Text Box to Multiple Cells in Excel


3. Employing VBA Macros to Link Textbox to Multiple Cells

You can insert a textbox from the Controls option of the Developer tab. Then, you need to use the VBA Macros to link the textbox to a cell. All you need is just to follow the steps.

📌 Steps:

  • Initially, 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 with the help of the (+) plus sign.

Inserted Textbox

  • Eventually, 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

  • Consequently, in the Visual Basic editor, write up 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 enter the command TextBox1.Text = Range(“C12”).Value

VBA code to link textbox to multiple cells in Excel

Finally, 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


4. Incorporating Data Validation Tool

You can use the Data Validation tool for creating a dynamic textbox. That means when you change a value from the drop-down list, the linked text box will change accordingly. Follow the below procedure to use it.

📌 Steps:

  • Firstly, select cell B5 and hover over the Data tab >> choose Data Validation from the Data Tools

Incorporating Data Validation Tool

  • At this moment, the Data Validation window pops out. Select List in the Allow box and type the Student Name in the Source
  • Lastly, hit OK.

Data Validation Window

  • Now, insert a textbox in cell B7, as we mentioned in Method 1. To establish the link of the cell input, the formula below.
=$B$5

Now the textbox is attached with cell B5.

Link cell to text

However, if you change the value from the dropdown, the textbox will change accordingly. See the below GIF.

GIF to show dynamic textbox

Read More: How to Edit Text Box in Excel


How to Convert TextBox to Cell in Excel

We can also change the textbox to cell content through the VBA code. It is pretty simple to use the code. But firstly, you need to insert textboxes to the cell B5:B11 range.

Using Text Box to Multiple cells

  • Eventually, navigate to the Developer tab >> choose Visual Basic.

Opening Visual Basic Editor

  • Subsequently, from the Visual Basic Editor, select the Insert tab >> Module>>Module 1.

Insert Module

  • Sequentially, write up the following code.
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

  • Moreover, 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.
  • Lastly, hit OK.

Convert Text Box to Cell dialog Window

As you can see, the entity in the textboxes has been converted into the cell value.


Practice Section

We have provided a practice section on each sheet on the right side for your practice. Please do it by yourself.

Practice Section


Download Practice Workbook

Download the following practice workbook. It will help you to realize the topic more clearly.


Conclusion

That’s all about today’s session. These are some easy methods to link textbox to multiple cells in Excel. Please let us know in the comments section if you have any questions or suggestions. For a better understanding, please download the practice sheet. Thanks for your patience in reading this article.


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