R
Roger on Excel
I use the following type of code to populate textboxes in userforms
Me.txt1.Value = ws.Range("A10").Value
Me.txt2.Value = ws.Range("A11").Value
Me.txt3.Value = ws.Range("A12").Value
Me.txt4.Value = ws.Range("A13").Value
Me.txt5.Value = ws.Range("A14").Value
Me.txt6.Value = ws.Range("A15").Value
Me.txt7.Value = ws.Range("A16").Value
Me.txt8.Value = ws.Range("A17").Value
etc etc...
Is there a way to use a "For i = 1 to 8" statement which will do the above
code : for example
Dim i as Integer
For i = 1 to 8
Me.txt & i.Value = ws.Range("A" & Cstr(i + 9))
Next i
Can anyone help with the syntax for this?
Many thanks,
Roger
Me.txt1.Value = ws.Range("A10").Value
Me.txt2.Value = ws.Range("A11").Value
Me.txt3.Value = ws.Range("A12").Value
Me.txt4.Value = ws.Range("A13").Value
Me.txt5.Value = ws.Range("A14").Value
Me.txt6.Value = ws.Range("A15").Value
Me.txt7.Value = ws.Range("A16").Value
Me.txt8.Value = ws.Range("A17").Value
etc etc...
Is there a way to use a "For i = 1 to 8" statement which will do the above
code : for example
Dim i as Integer
For i = 1 to 8
Me.txt & i.Value = ws.Range("A" & Cstr(i + 9))
Next i
Can anyone help with the syntax for this?
Many thanks,
Roger