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.
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.
Not to mention, we have used Microsoft 365 version. You may use any other version at your convenience.
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.
- Initially, calculate the Total Sales. Then link the two cells in cell B13 with the below formula.
- Apparently, move to the Insert tab >> Text >> Text Box.
- Eventually, a textbox has been created like the image below.
- Consequently, select the textbox and go to the formula bar to link the desired cells.
- Additionally, insert the below formula.
- After that, press ENTER.
Finally, the cells are linked to the text box like in the image below.
Moreover, do some formatting to give a stylish outlook to the textbox like ours.
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.
- Firstly, move to cell B13 and enter the formula.
- Subsequently, insert the textbox as we mentioned in Method 1 and link it with the below formula.
- Sequentially, press ENTER and format the textbox. The final output is like the image below.
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.
- Initially, navigate to the Developer tab >> Choose Insert from the Controls option >> pick Text Box under ActiveX Control.
- Draw a text box with the help of the (+) plus sign.
- Eventually, right-click on the sheet name and choose View Code from the Context Menu.
- 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
Finally, run the code with the F5 key, and you will find that the cell is linked to the textbox.
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.
- Firstly, select cell B5 and hover over the Data tab >> choose Data Validation from the Data Tools
- 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.
- Now, insert a textbox in cell B7, as we mentioned in Method 1. To establish the link of the cell input, the formula below.
Now the textbox is attached with cell B5.
However, if you change the value from the dropdown, the textbox will change accordingly. See the below GIF.
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.
- Eventually, navigate to the Developer tab >> choose Visual Basic.
- Subsequently, from the Visual Basic Editor, select the Insert tab >> Module>>Module 1.
- 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
- 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.
As you can see, the entity in the textboxes has been converted into the cell value.
We have provided a practice section on each sheet on the right side for your practice. Please do it by yourself.
Download Practice Workbook
Download the following practice workbook. It will help you to realize the topic more clearly.
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.