LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Checking routine more important right now

Maria

The GotFocus Event is automatically triggered when you select the button by
clicking on it. So, before the Click event fires, the GotFocus should fire.

The "how to find out what is selected." is done by telling your routine what
is selected. Every Object will have its own GotFocus Code - Not just one
for the whole sheet - so each one tells the General Routine which button it
is"
Eg CommandButton1_GorFocus()
Run "MyGeneralCheckingRoutine", "CommandButton1"
Eg CommandButton2_GorFocus()
Run "MyGeneralCheckingRoutine", "CommandButton2"
Eg TextBox1_GorFocus()
Run "MyGeneralCheckingRoutine", "TextBox1"
Eg CommandButton3_GorFocus()
Run "MyGeneralCheckingRoutine", "CommandButton3"

Nick
"Maria J-son" wrote:

Hi and thanks,

I'll look more into how to trig it. Now, more important is the actual
checking routine - how to find out what is selected.

/Regards

"Nicholas B" skrev i meddelandet
...
Maria

As far as I can see the WorkSheet Selection Change only works with changes
to cells, it doesn't seem to fire as you chose different buttons.
To get around this I suggest you use the GotFocus Event of each object
(TextBox, CommandButton, etc)
Write something into the GotFocus Method that fires a common checking
routine
Eg
Private Sub CommandButton1_GotFocus()
Run "MyGeneralCheckingRoutine", "CommandButton1"
End Sub

Your Checking Routine is then being told which Object has been selected
and
you can act on that

Hope this helps

Nick
"Maria J-son" wrote:

Hi,
To a routine, I need to know what is selected on worksheet_change and
worksheet_selectionchange. I need It to take different actions depending
on
the type... Selections could be like

Cells
Buttons
CheckBoxes
TextBox
Worksheets
ChartObjects

Most important right now is to find if it is a button selected (in the
shapes collection i think, not OLE). The other types in the list will
soon
come to, however.

Can somebody please share a good routine for this?

/Regards






 
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
Multiple cells or columns are selected instead of selected cell or Mikey Excel Discussion (Misc queries) 1 April 29th 09 09:48 PM
Cells are selected but aren't displayed as selected Nifty Excel Discussion (Misc queries) 2 September 17th 06 07:22 PM
Cells are selected but aren't displayed as selected Nifty Excel Worksheet Functions 0 September 17th 06 11:34 AM
Macro to take selected cells times a selected cell Craig Excel Programming 4 October 24th 05 12:54 AM
how do i make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. Daniel Excel Worksheet Functions 1 July 12th 05 01:30 AM


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