There has to be an easier way...
I have 60 userform text boxes (txtBox1, txtBox2, etc.) that I need to insert values from the spreadsheet. What I am using now is:
frmPax.txtBox1.Value = Range("A1")
frmPax.txtBox2.Value = Range("A2")
...
...
Instead of using 60 lines of code I would like to use a loop that simply changes the last digit of the textbox via the loop counter and also offsetting the cell Range down by one cell for each loop.
When I try
frmPax.txtBox(i). Value
where i is the counter number I get an error message saying method or date member not found.
Is there an easy way to do this?
Thanks in advance for any help.
I have 60 userform text boxes (txtBox1, txtBox2, etc.) that I need to insert values from the spreadsheet. What I am using now is:
frmPax.txtBox1.Value = Range("A1")
frmPax.txtBox2.Value = Range("A2")
...
...
Instead of using 60 lines of code I would like to use a loop that simply changes the last digit of the textbox via the loop counter and also offsetting the cell Range down by one cell for each loop.
When I try
frmPax.txtBox(i). Value
where i is the counter number I get an error message saying method or date member not found.
Is there an easy way to do this?
Thanks in advance for any help.