Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Command Button

Hello,

I hope someone can help with my question.
Is it possible to have one macro, that when activated by a
command button, make the cell beneath the command button
active? For example, I would have 10 command buttons on
cells C11 thru C20 (one over each cell). If any one of
these are clicked, the cell beneath is now the active
cell.
I'm trying to avoid having 10 individual macros assigned
to the buttons (one per button). I just wasn't sure if
one simple macro could be written that takes into account
the buttons position for setting the active cell.

Thanks in advance,
wjd01
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Command Button

If you use buttons from the Forms toolbar they can all have the same macro:

ActiveSheet.Buttons(Application.Caller).TopLeftCel l.Select

If you're using the Control Toolbox command button it may be harder...

--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Command Button

Thanks Jim. This worked perfectly.

wjd01
-----Original Message-----
If you use buttons from the Forms toolbar they can all

have the same macro:

ActiveSheet.Buttons

(Application.Caller).TopLeftCell.Select

If you're using the Control Toolbox command button it may

be harder...

--
Jim Rech
Excel MVP


.

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
command button add another command Wanna Learn Excel Discussion (Misc queries) 5 December 7th 08 11:42 PM
Command button Mark New Users to Excel 4 March 10th 05 02:37 PM
Command Button vs Control Button RGibson Excel Programming 1 October 14th 03 02:24 AM
Command Button vs Form Button T K Excel Programming 4 August 26th 03 07:26 PM
command button George[_15_] Excel Programming 5 August 9th 03 11:49 AM


All times are GMT +1. The time now is 10:23 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"