Andres Benes
New Member
- Joined
- Apr 11, 2012
- Messages
- 7
Hi Forum,
I am trying to link a value in a textbox to a specific cell. I.e. value in textbox 1 needs to be displayed in cell A1 sheet 1 for instance. I ahve tried below code :
Sub Copyvalue()
Sheets("Sheet1").Range("A1") = TextBox1.Value
End Sub
But this gives me the error : runtime error 424 - object required. I have also tried below code :
Sub textbox_test1()
Dim strTB As String
strTB = Worksheets("Sheet1").Shapes("TextBox 1").TextFrame.Characters.Text.Value
strTB = Mid(strTB, 3, Len(strTB) - 3) 'Strips unwanted =" and " chars from start/end
Worksheets("Sheet1").range ("A1").Shapes(strTB).TextFrame.Characters.Text
End Sub
But also no luck. What is wrong in above code and what would the correct way to do this action ? I am using excel 2013
I am trying to link a value in a textbox to a specific cell. I.e. value in textbox 1 needs to be displayed in cell A1 sheet 1 for instance. I ahve tried below code :
Sub Copyvalue()
Sheets("Sheet1").Range("A1") = TextBox1.Value
End Sub
But this gives me the error : runtime error 424 - object required. I have also tried below code :
Sub textbox_test1()
Dim strTB As String
strTB = Worksheets("Sheet1").Shapes("TextBox 1").TextFrame.Characters.Text.Value
strTB = Mid(strTB, 3, Len(strTB) - 3) 'Strips unwanted =" and " chars from start/end
Worksheets("Sheet1").range ("A1").Shapes(strTB).TextFrame.Characters.Text
End Sub
But also no luck. What is wrong in above code and what would the correct way to do this action ? I am using excel 2013