Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tod tod is offline
external usenet poster
 
Posts: 114
Default Event to fire when pivottable is pivoted

I'm trying to write code that will run when the user moves
pivot fields between page and row area.

My first idea was to enter a formula:

=Counta(A:A)

It's not a guarantee, but most times this would cause the
formula to change. So then I coded the Worksheet_Change
event. Of course this did not work because the Change
event looks for the actual content of the cell to change,
not the value of the formula. So I put my code in a
Worksheet Calculate event. This works, but the event will
run ANYTIME something on the sheet calculates. I don't
know any code that would limit the event to a range.

So... what can I do (Excel 2000 or older) to have code run
only when the pivot table is pivoted.

tod
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Event to fire when pivottable is pivoted

This isn't an ideal solution. But when you change the
layout of the PivotTable a worksheet Selection change
event will always fire. So you can run a procedure that
determines if the new state of the Worksheet layout is
equal to the previous state, use static variables/arrays
perhaps. If the layout is different, then run another
procedure.

-Brad
-----Original Message-----
I'm trying to write code that will run when the user

moves
pivot fields between page and row area.

My first idea was to enter a formula:

=Counta(A:A)

It's not a guarantee, but most times this would cause the
formula to change. So then I coded the Worksheet_Change
event. Of course this did not work because the Change
event looks for the actual content of the cell to change,
not the value of the formula. So I put my code in a
Worksheet Calculate event. This works, but the event will
run ANYTIME something on the sheet calculates. I don't
know any code that would limit the event to a range.

So... what can I do (Excel 2000 or older) to have code

run
only when the pivot table is pivoted.

tod
.

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
Counting NONZERO Cells - Filtered and Pivoted RJB Excel Discussion (Misc queries) 6 December 15th 07 12:29 AM
Event doesn't fire Frank Xia Excel Discussion (Misc queries) 6 February 11th 06 12:54 AM
Worksheet_Change event won't fire to execute Macro??? jpdill5 Excel Programming 2 February 13th 04 02:34 PM
Workbook_SheetChange will not fire Robert Willard Excel Programming 1 September 10th 03 07:52 PM
How do I get Pivot filter change event to fire? Claude Excel Programming 4 August 15th 03 10:24 PM


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