my userform contain 30 TextBox there Name is TextBox 1 To TextBox 30.
i like Ode Number of TextBox (e.g.) TexBox1, TextBox3,TextBox5........
Textbox background Color is Black
and other is Even number TextBox Bcckground Color is White
i try by for loop the code i below what is wrong in code
Dim i As Integer
Dim z As Integer
z = 0
For i = 3 To 52
If i Mod 2 = 1 Then
Me.Controls("TextBox" & i).BackColor = RGB(0, 0, 0)
Next i
z = z + 1
Else
Me.Controls("TextBox" & i).BackColor = RGB(255, 255, 255)
End If
Next i
end sub
i like Ode Number of TextBox (e.g.) TexBox1, TextBox3,TextBox5........
Textbox background Color is Black
and other is Even number TextBox Bcckground Color is White
i try by for loop the code i below what is wrong in code
Dim i As Integer
Dim z As Integer
z = 0
For i = 3 To 52
If i Mod 2 = 1 Then
Me.Controls("TextBox" & i).BackColor = RGB(0, 0, 0)
Next i
z = z + 1
Else
Me.Controls("TextBox" & i).BackColor = RGB(255, 255, 255)
End If
Next i
end sub