I have a around 10 cFmtCell commandbuttons on a userform.
Instead of repeating the following code for 10 times, with varying indices at the end, is there a more convenient way to write the code?
Thanks a lot!
Instead of repeating the following code for 10 times, with varying indices at the end, is there a more convenient way to write the code?
Code:
Private Sub [COLOR=#ff0000]cFmtCell7[/COLOR]_Click()
Call FmtCellTxt([COLOR=#ff0000]cFmtCell7[/COLOR].BackColor, vbWhite)
Unload Me
End Sub
Private Sub [COLOR=#FF0000]cFmtCell8[/COLOR]_Click()
Call FmtCellTxt([COLOR=#FF0000]cFmtCell8[/COLOR].BackColor, vbWhite)
Unload Me
End Sub
Private Sub [COLOR=#FF0000]cFmtCell9[/COLOR]_Click()
Call FmtCellTxt([COLOR=#FF0000]cFmtCell9[/COLOR].BackColor, vbWhite)
Unload Me
End Sub
Thanks a lot!