[RESOLVED] getting a private sub to run on startup
Hi
I have a private sub routine called 'initProductForm' and this does everything I want when called from a click event; initialises listboxes, populates listboxes, sets screen messages to blank, etc.
I want the routine to run when the workbook opens and rather than duplicate the code I would like to call the routine when the workbook opens.
How best to go about achieving this?
Thanks
Re: getting a private sub to run on startup
put
initProductForm.show
in the workbook open event
Re: getting a private sub to run on startup
Isn't that for calling a form?
Sorry, I should have been clearer in my original post.
I have a sub routine in 'sheet1' called 'InitProduct' and this is a few lines of code that populates a listbox. I want the same code to run whenever the workbook opens but I don't want to copy / paste the same code to different modules.
So in 'Thisworkbook' module I have a call to 'InitProduct' but the procedure is not found.
Is there a way from the 'Thisworkbook' module to call sheet1 module called 'InitProduct'?
Thanks
Re: getting a private sub to run on startup
prefix with sheet
make sure sub procdure is not private