How do I cycle through buttons in a FOR loop?
I've got this piece of code which is obsiously not working:
For i = 1 To Worksheets.Count
TempForm.CommandButton & i & .Caption = Worksheets(i).Name
Next i
But I need to assign different captions based on sheet names.. How do
I achieve that?
Cheers,
Morris
|