Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can excel count concurrent events given start and end times ? | Excel Discussion (Misc queries) | |||
copy dates, events and times into a montly calendar | Excel Worksheet Functions | |||
Capturing excel insert/delete events. | Excel Worksheet Functions | |||
Capturing Insert/Delete Events in Excel Sheet using c# | Excel Worksheet Functions | |||
how to compare times of events btwn worksheets | Excel Worksheet Functions |