Referencing worksheet controls

F

Frederick Chow

Hi all,

Suppose I have a command button (cmdCommandButton1) in a worksheet named
"Sheet1". How can I refer to this control outside this sheet?

I tried this one but didn't work:

Worksheets("Sheet1").CommandButton1

Thanks for your advice.

Frederick Chow
Hong Kong.
 
K

Kevin B

Under Excel objects in the Project Explorer, select the sheet that has the
command button. You can then reference the button using the "Me" keyword.

If the button is named cmd1 Me.cmd1.Select would select the comman button.
 
F

Frederick Chow

Sorry, some misunderstanding...

What I meant really was if cmdCommandButton1 is located on sheets other than
"Sheet1".

Thanks for your advice in advance.

Frederick Chow
 

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