Hi, just a quick question, I wonder if there a better way to write the lines below, just trying to simplify and learn more elegant ways of writing codes,
Thanks all, hope u all well
[CODE]
Dim i As Integer
Dim textTab As Variant
Dim ctl As Control
Thanks all, hope u all well
[CODE]
Dim i As Integer
Dim textTab As Variant
Dim ctl As Control
Code:
For i = 0 To 9
Set ctl = Me.Controls("cmd" & i + 1)
If i <= UBound(textTab) Then ctl.Caption = textTab(i)
If i > UBound(textTab) Then ctl.Visible = False
Next i
Comment