To post as a guest, your comment is unpublished.· 1 years agoIt 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.
To post as a guest, your comment is unpublished.
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.
Recommended Excel Productivity Tools
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() 'UpdatebyExtendoffice20160918 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 xTxtBox.Delete xRow = xRow + 1 Next End Sub
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:
4. Click OK. Now all text boxes have been converted to cell contents.
Recommended Productivity Tools for Excel
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.· 1 years agoVBA not working?!