Worksheet_SelectionChange question

  • Thread starter Thread starter Gary Keramidas
  • Start date Start date
G

Gary Keramidas

just wondering, i have a calendar control that fires on B2. but i notice when stepping through the code after the date is entered, this code fires , even though it exits because the target cell is not being changed.

a lot of processing is done on this sheet and i'm wondering if this slows things down.
 
Gary,

The macro will be called for any worksheet change event but the amount of
code execution is usually controlled at the start of the macro with something
along the lines of

If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Address = "$B$2" Then

This ends the macro for 3 most common you wouldn't want it it execute.

1. More than 1 cell selected
2. The target cell has no value in
3. It's not the intended target cell.

Mike
 
i have all of that, i'm saying it exits without doing anything, but it's
processed thousands of times. just wondering if it slows the code down.
 
Maybe you want a worksheet_change event which fires when you change the cell instead of selecting it
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
"Gary Keramidas" <GKeramidasATmsn.com> wrote in message just wondering, i have a calendar control that fires on B2. but i notice when stepping through the code after the date is entered, this code fires , even though it exits because the target cell is not being changed.

a lot of processing is done on this sheet and i'm wondering if this slows things down.
 
i want the calendar to pop up when the cell is clicked. but i've already deleted it, probably more trouble than it's worth.

thanks, don.

--


Gary


Maybe you want a worksheet_change event which fires when you change the cell instead of selecting it
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
"Gary Keramidas" <GKeramidasATmsn.com> wrote in message just wondering, i have a calendar control that fires on B2. but i notice when stepping through the code after the date is entered, this code fires , even though it exits because the target cell is not being changed.

a lot of processing is done on this sheet and i'm wondering if this slows things down.
 

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

Back
Top