I've been trying to figure out a way to change the text value of 47 activex textboxes without naming them all individually.
while both below codes work on single textboxes:
I cannot get the variable part to work at all
seems like I'm missing something stupidly easy, does anyone have any suggestions? the text I want to change them too will always be "None"
I was linking these to a cell and changing the cell, but the code took too long, so I want to see if this will be a speed improvement doing it this way.
while both below codes work on single textboxes:
VBA Code:
Sheets("LOSS").OLEObjects("TextBox2").Object.Text = "None" '(example1)
Sheets("LOSS").TextBox1.Value = "None" '(example2)
I cannot get the variable part to work at all
VBA Code:
Dim i As Integer
For i = 1 To 47
Sheets("LOSS").OLEObjects("TextBox & i").Object.Text = "None" '(example1)
Sheets("LOSS").TextBox & i.Value = "None" '(example2)
next i
seems like I'm missing something stupidly easy, does anyone have any suggestions? the text I want to change them too will always be "None"
I was linking these to a cell and changing the cell, but the code took too long, so I want to see if this will be a speed improvement doing it this way.