-
Hi,
How can I pass a control array of command buttons to a function and use it?
I have 4 arrays of command buttons and want to pass each to a function that will change some of their properties.
CommandArrayOne(11)
CommandArrayTwo(11)
CommandArrayThree(11)
CommandArrayFour(11)
Basically I have something like this but it doesn't work:
'------------------------------------------------
Private Sub MySub(ACommandArray() As CommandButton)
For ctr = 1 to 10
ACommandArray(ctr).visible = False
Next ctr
End Sub
'------------------------------------------------
'I wanted to use it like:
MySub CommandArrayOne
Thanks
-
Code:
Private Sub MySub(cmdCommandButton As Object)
For I = cmdCommandButton.lbound To cmdCommandButton.ubound
cmdCommandButton(I).Visible = False
Next I
End Sub
Usage:
Code:
MySub CommandArrayOne