# How to Convert Text Box to Cell in Excel (with Easy Steps)

Get FREE Advanced Excel Exercises with Solutions!

In this tutorial, I am going to show you the step-by-step procedures on how to convert a text box to a cell in Excel. You can use these steps for any type of dataset to quickly convert text boxes to cell values. Throughout this tutorial, you will also learn some important Excel tools and techniques that will be very useful in any Excel-related task.

## How to Convert Text Box to Cell in Excel: with Easy Steps

We have taken a concise dataset to explain the steps clearly. The dataset has approximately 6 rows and 3 columns. Initially, we are keeping all the cells in General format. For all the datasets, we have 3 unique columns which are Employee Name, Location (TextBox), and Location (Cell). Although we may vary the number of columns later on if that is needed.

### Step-1 Creating Base Dataset

In this first step, we will create the starting Excel dataset for our operation. Follow the steps below to do this.

• First, insert the following columns with the sample employee names.
• Then, insert some text boxes and enter the locations as in the image below.

### Step-2 Inserting VBA Code

Now, we have to insert the necessary VBA code that will convert the text box to a cell. Let us see how to do this.

• For this method, go to the Developer tab and select Visual Basic.

• Now, select Insert in the VBA window and click on Module.

• Next, type in the formula below in the new window:
``````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``````

Here, we are creating an input box to take user input using the Application.InputBox method. Next, ActiveWindow.RangeSelection method represents cells that the users select.

### Step-3 Running VBA Macro

Once we have inserted the VBA code inside the module, we can run this code directly from the Macros option. Here are the steps to achieve this.

• To begin with, click on the Developer tab again and select Macros.

• Then, select the macro name and click on Run.

• Consequently, this will show a popup window.
• Here, click on the cell in which you want to enter the data and click OK.

• As a result, this will convert the text box values into cell values as we wanted.

## How to Convert Cell to Text Box in Excel

If you want to perform the reverse operation of what we did previously, then you can follow this method to quickly convert a cell to a text box in Excel.

Steps:

• To start with, click on the icon in the top left corner of the worksheet, as in the image below.
• Next, click on the Fill Color drop-down above.

• Then, select any color as the Fill Color.

• Now, click on any of the cells to convert it to a text box.

• After that, press Ctrl+1 to open Format Cells.
• Then, go to the Fill tab and select the color, White.

• Next, go to the Border tab and set the top and left border as the color black.
• Similarly, set the bottom and right border as the color white.
• Now, click on OK.

• Finally, this should format the cell as a text box.

Read More: How to Anchor Text Box in Excel

## How to Create Dynamic Text Box in Excel

In this final method, we will see a very important feature that Excel has, which allows us to create dynamic text boxes instead of hard-coding the data into them.

Steps:

• Firstly, select cell B5 and go to the Data tab at the top of the screen.
• Now, click on Data Validation under Data Tools.

• Next, in the Data Validation window, set List as the Allow option from the drop-down.
• Then, type the employee names in the Source field as in the image below and click OK.

• Immediately, this will insert a drop-down list inside cell B5.

• Now, click on cell B7 and go to the Insert tab thereafter.
• Then, click on Text Box under Text.

• After that, type in the following formula inside the text box:
`=\$B\$5`
• Then, press Enter.

• Finally, this will create a dynamic text box.

## Conclusion

I hope that you were able to apply the methods that I showed in this tutorial on how to convert a text box to a cell in Excel. As you can see, it involves quite a few steps to achieve this. So carefully follow these while applying them to your dataset. If you get stuck in any of the steps, I recommend going through them a few times to clear up any confusion. If you have any queries, please let me know in the comments.

## What is ExcelDemy?

ExcelDemy Learn Excel & Excel Solutions Center provides free Excel tutorials, free support , and premium Excel consultancy services for Excel and business users. Feel free to contact us with your Excel projects.
Nazmul Hossain Shovon

Hello, I am Nazmul Hossain. I am currently working full-time in Exceldemy as an Excel & VBA Content Developer. I have completed my bachelors in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology. I am interested in working with MS Excel. I also like coding web applications a lot.

We will be happy to hear your thoughts

Advanced Excel Exercises with Solutions PDF