Note: The other languages of the website are Google-translated. Back to English

How to convert text in text box to cell content in Excel?

If there are some text boxes in a sheet, and you want to convert the contents in the text boxes into cells separately as below screenshot shown, are there any quick ways to solve this job except entering one by one in Excel? In this article, I introduce a macro to do you a favor on this problem.
doc convert textbox to cell 1

Convert text box contents to cell with VBA

arrow blue right bubble Convert text box contents to cell with VBA

Except macro code, there is no trick that can quickly convert text boxes to cell contents.

1. Press Alt + F11 keys to enable Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and then paste below code to the Module script.

VBA: Convert text boxes to cell

Sub TextboxesToCell()
    Dim xRg As Range
    Dim xRow As Long
    Dim xCol As Long
    Dim xTxtBox As TextBox
    Set xRg = Application.InputBox("Select a cell):", "Kutools for Excel", _
                                    ActiveWindow.RangeSelection.AddressLocal, , , , , 8)
    xRow = xRg.Row
    xCol = xRg.Column
    For Each xTxtBox In ActiveSheet.TextBoxes
        Cells(xRow, xCol).Value = xTxtBox.Text
        xRow = xRow + 1
End Sub

doc convert textbox to cell 2

3. Press F5 key to run the code, a dialog pops out to remind you select a cell to export the textbox contents. See screenshot:
doc convert textbox to cell 3

4. Click OK. Now all text boxes have been converted to cell contents.
doc convert textbox to cell 4

Tip.If you want to quickly convert between number and text, please try to use the Kutools for Excel’s Convert between Text and Number as shown in the following screenshot. It’s full function without limitation in

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 
days, please download and have a free trial now.
doc convert textbox to cell 5

The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
VBA not working?!
This comment was minimized by the moderator on the site
It works perfectly here. What happen while you running the code? It changes nothing? If you could, please describ more about your data and problem. Thank you.
This comment was minimized by the moderator on the site
Not working here either. Select destination cell, click OK, and nothing happens.
This comment was minimized by the moderator on the site
I have tried it in Win10 Excel2016 and Win8 Excel2010, it works both. What working enviroment you use?
This comment was minimized by the moderator on the site
I have many Boxes in different sheets, There are 4 sheets which are having particular events on particular day and i would like to take that text boxes of particular day to new sheet combined for that day, How it works i have no idea how to get that data from 4 different sheet to one sheet.
This comment was minimized by the moderator on the site
Okay, I have Textbox inside Textbox that need to be extracted.
This comment was minimized by the moderator on the site
Muchas gracias! Buen aporte. Me ayudó mucho.
This comment was minimized by the moderator on the site
No me funcionó. Hago todo lo señalado y no pasa nada después de apretar enter. Intenté algunos cambios en la programación y tampoco
This comment was minimized by the moderator on the site
Hi, Juan, there is no Enter key mentioned in the method above, copy and paste the vba, then press F5 key or click the Run button to enable the code.
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations