Link to home
Start Free TrialLog in
Avatar of bikeski
bikeskiFlag for United States of America

asked on

Excel Copy Text Box to cell

Hello Experts,

I'd like a sub routine to copy the text from a predetermined textbox into a cell on the current worksheet. The various textboxes will be on a separate worksheet.

1) There are several potential textbox choices, the textbox name will come from cell "b2". i.e. "RadiantText" or "InsulationText"

2) The contents of the textbox needs to be pasted into cell "d3"
Avatar of Flora Edwards
Flora Edwards
Flag of Sweden image

here you go

Sub TextBoxes()
Dim tbx As OLEObject
For Each tbx In ActiveSheet.OLEObjects

If TypeName(tbx.Object) = "TextBox" Then
For i = 1 To 1000
tbx.Object.Text = Cells(i, 1).Value
Next i
End If
Next
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial