Help! Can't refer to a subroutine on a worksheet

D

Duncan

I am writing a subroutine attached to a command button on a sheet that
looks through all the other sheets in the worksheets() collection and,
if applicable, runs the commandbutton1_click subroutine on each sheet.
Unfortunately different sheets have different commandbutton1 code but
the subroutine I'm writing needs to 'click' them all. I've made
commandbutton1_click public on each sheet.

No luck with worksheets(n).commandbutton1_click. Any suggestions how to
do this?

Thanks everyone!
 
B

Bob Phillips

Go by the codename

application.run worksheets(n).codename & ".commandbutton1_click"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
D

Duncan

Works great!


Bob said:
Go by the codename

application.run worksheets(n).codename & ".commandbutton1_click"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top