I would like to do something like what is in the title... switch between textboxes (all ordered name-wise numerically) using a loop or for. I'm currently doing the following, which isn't very scalable.
I get some error when I try to run, can't remember exactly what the message said, sorry.
I go on to then switch to the sheet (which the user has put into the textbox) and process it.
I get some error when I try to run, can't remember exactly what the message said, sorry.
Code:
If TextBox2.Value <> "" Then
numberofsheets = numberofsheets + 1
textboxname(2) = TextBox2.Value
If TextBox3.Value <> "" Then
numberofsheets = numberofsheets + 1
textboxname(3) = TextBox3.Value
If TextBox4.Value <> "" Then
numberofsheets = numberofsheets + 1
textboxname(4) = TextBox4.Value
If TextBox5.Value <> "" Then
numberofsheets = numberofsheets + 1
textboxname(5) = TextBox5.Value
End If
End If
End If
End If
I go on to then switch to the sheet (which the user has put into the textbox) and process it.
Last edited: