Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Referencing worksheet controls

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Referencing worksheet controls

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
"Kevin B" wrote in message
...
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.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls in a Worksheet Jeff Excel Programming 4 July 11th 05 11:59 PM
Controls on worksheet gr8guy Excel Programming 1 May 1st 04 03:11 AM
controls on worksheet jim c. Excel Programming 3 February 9th 04 06:43 PM
Worksheet Controls Andrew Arthur Excel Programming 0 February 5th 04 06:46 PM
Referencing to controls on a worksheet John Nikolopoulos Excel Programming 3 September 10th 03 10:08 AM


All times are GMT +1. The time now is 12:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"