Why not use a template with the controls and code in place? You can read
sheet names, position and change captions and refer to GOTO locations by
reference. I do not see a need to write module code.
--
Regards,
Nigel
(E-Mail Removed)
"WLMPilot" <(E-Mail Removed)> wrote in message
news:34988583-122B-4490-8A09-(E-Mail Removed)...
>I was wondering, and probably reaching for this one, if a macro can write
> another macro and place it in the appropriate "Microsoft Excel Object"
> sheet?
>
> The project I am working on is a annual scheduling workbook that will
> create
> 26 sheets (payperiods) when a commandbutton is clicked and name each sheet
> accordingly. During this execution, I was wondering if I could also:
>
> 1) create 26 commandbuttons with same caption as its respective sheet,
> size
> and align each button on a sheet,
> 2) write the three line code for each commandbutton, using the caption
> (also
> name of sheet) as the reference to GOTO that sheet?
>
> Just curious about number 2.
>
> Thanks,
> Les