Hello,
I able to transfer values from textboxes already created on a userform but I am struggling on transferring the values of textboxes that are created dynamically when the userform is loaded.
Attached is a sample workbook. Textbox1 and Textbox2 where already created on the userform but TxBx_E1_01, TxBx_E1_02 and TxBx_E1_03 are created dynamically when the userform is loaded.
When I load the form and populated all the textboxes and I click on the commandbutton, it runs the following macro to save values to the worksheet
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
ws.Range("A1") = TextBox1.Value
ws.Range("A2") = TextBox2.Value
ws.Range("A3") = TxBx_E1_01.Value 'Dynamically created, error
ws.Range("A4") = TxBx_E1_02.Value 'Dynamically created, error
ws.Range("A5") = TxBx_E1_03.Value 'Dynamically created, error
End Sub
I get the following error on the first line of the dynamically created textboxes: Run-time error 424: object required
I try to search the web but could find the answer to this. Thank you for your time!
Bookmarks