Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Worksheet_SelectionChange question

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Worksheet_SelectionChange question

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


"Gary Keramidas" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Worksheet_SelectionChange question

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.

--


Gary


"Mike H" wrote in message
...
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


"Gary Keramidas" wrote:

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Worksheet_SelectionChange question

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

"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.

--



Gary


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Worksheet_SelectionChange question

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


"Don Guillett" wrote in message ...
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

"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.

--



Gary


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
Worksheet_SelectionChange Question a Excel Programming 3 August 21st 06 05:50 AM
Worksheet_SelectionChange Gary''s Student Excel Programming 3 April 5th 06 09:46 AM
Worksheet_SelectionChange mangesh_yadav[_144_] Excel Programming 0 October 25th 04 12:56 PM
Worksheet_SelectionChange mangesh_yadav[_143_] Excel Programming 1 October 25th 04 11:49 AM
Worksheet_SelectionChange Rasmus[_2_] Excel Programming 2 June 27th 04 07:19 PM


All times are GMT +1. The time now is 04:15 AM.

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"