View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Kevin B[_5_] Kevin B[_5_] is offline
external usenet poster
 
Posts: 17
Default Referencing worksheet controls

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.
--
Kevin Backmann


"Frederick Chow" wrote:

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.