Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 188
Default Which Events Fire When I Delete A Row, and How Many Times?


Hi All,

When I delete a complete row in a worksheet, which events are firing,
and more importantly, do they fire once for the deletion of the row,
or do they fire 256 times, once for the deletion of each cell in the
row?

What if I delete two rows? Do they fire once, for the deletion of the
range, twice being once for each row, or 512 times being once for each
cell?

Thanks,

Alan.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Which Events Fire When I Delete A Row, and How Many Times?

Hi Alan,

The Worksheet_Change event fires in Excel 2000 and higher (but not in
Excel 97) when you delete rows on a worksheet. It fires one time, regardless
of how many rows you delete. The Target argument to the event passes you the
address of the rows that were deleted.

The change event fires for lots of other reasons as well, so it's quite
difficult to sort out row deletions from other actions that triggered the
change event. The simplest, although by no means foolproof, method is to
determine if the Target address returned by the change event refers to an
entire row.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Alan" wrote in message
...

Hi All,

When I delete a complete row in a worksheet, which events are firing,
and more importantly, do they fire once for the deletion of the row,
or do they fire 256 times, once for the deletion of each cell in the
row?

What if I delete two rows? Do they fire once, for the deletion of the
range, twice being once for each row, or 512 times being once for each
cell?

Thanks,

Alan.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 188
Default Which Events Fire When I Delete A Row, and How Many Times?

"Rob Bovey" wrote in message
...

Hi Alan,

The Worksheet_Change event fires in Excel 2000 and higher (but
not in Excel 97) when you delete rows on a worksheet. It fires one
time, regardless of how many rows you delete. The Target argument to
the event passes you the address of the rows that were deleted.

The change event fires for lots of other reasons as well, so

it's
quite difficult to sort out row deletions from other actions that
triggered the change event. The simplest, although by no means
foolproof, method is to determine if the Target address returned by
the change event refers to an entire row.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/


Thanks Rob,

That's great - much apprciated.

I had not realised that I could have worked that out for myself by
trapping and returning the Target address.

Regards,

Alan.


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
Can excel count concurrent events given start and end times ? Charlie B Excel Discussion (Misc queries) 4 April 21st 23 02:54 PM
copy dates, events and times into a montly calendar RoxAnn Excel Worksheet Functions 1 December 16th 09 08:09 PM
Capturing excel insert/delete events. Gaurav Nanda[_2_] Excel Worksheet Functions 1 July 10th 09 11:09 PM
Capturing Insert/Delete Events in Excel Sheet using c# Gaurav Nanda[_2_] Excel Worksheet Functions 0 July 10th 09 06:14 AM
how to compare times of events btwn worksheets daveg Excel Worksheet Functions 1 February 28th 09 08:35 PM


All times are GMT +1. The time now is 11:06 AM.

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

About Us

"It's about Microsoft Excel"