View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Morris[_2_] Morris[_2_] is offline
external usenet poster
 
Posts: 25
Default 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