Hello
I have the following code:
Private Sub Form_Load()
Dim lngBool As Boolean
lngBool = fCmdButTextPic(Me.CmdColorButton1, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton2, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton3, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton4, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton5, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton6, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton7, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton8, 12058623)
End Sub
The real code has many more likewise lines as the buttons are 1 to 100.
Can someone help by changing code to a simple loop so I don’t have to write the lines 100 times?
Thank you
I have the following code:
Private Sub Form_Load()
Dim lngBool As Boolean
lngBool = fCmdButTextPic(Me.CmdColorButton1, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton2, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton3, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton4, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton5, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton6, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton7, 12058623)
lngBool = fCmdButTextPic(Me.CmdColorButton8, 12058623)
End Sub
The real code has many more likewise lines as the buttons are 1 to 100.
Can someone help by changing code to a simple loop so I don’t have to write the lines 100 times?
Thank you