Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Richard
 
Posts: n/a
Default Worksheet change with pivot table

Using: MS OS XP
Excel 2003

I have a pivot table that needs to be reformatted each time you change data.
For example going from all years to 2003. I have created a macro that will
re-format as needed.

I have found no way to trigger this macro except manually via a control. I
would like the macro to run every time the worksheet changes due to making
different selections.

I have tried the worksheet change event but it doesnt seem to work on the
pivot table, I can get it to work on a regular worksheet.

Please help.

Thanks in advance.

--
Richard
  #2   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default Worksheet change with pivot table

If you're changing the pivot table, you can use the
Worksheet_PivotTableUpdate event.

Richard wrote:
Using: MS OS XP
Excel 2003

I have a pivot table that needs to be reformatted each time you change data.
For example going from all years to 2003. I have created a macro that will
re-format as needed.

I have found no way to trigger this macro except manually via a control. I
would like the macro to run every time the worksheet changes due to making
different selections.

I have tried the worksheet change event but it doesnt seem to work on the
pivot table, I can get it to work on a regular worksheet.

Please help.

Thanks in advance.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.misc
Richard
 
Posts: n/a
Default Worksheet change with pivot table

Debra, after reading your post I tried the Worksheet_PivotTableUpdate event.
I guess I don't know enough VBA to write it.

I have a macro I wish to run when the changes occur. The Macro name is
"Format_Pivot_Table".

Can you give me some direction on writing this?

Thanks in advanced.
--
Richard


"Debra Dalgleish" wrote:

If you're changing the pivot table, you can use the
Worksheet_PivotTableUpdate event.

Richard wrote:
Using: MS OS XP
Excel 2003

I have a pivot table that needs to be reformatted each time you change data.
For example going from all years to 2003. I have created a macro that will
re-format as needed.

I have found no way to trigger this macro except manually via a control. I
would like the macro to run every time the worksheet changes due to making
different selections.

I have tried the worksheet change event but it doesnt seem to work on the
pivot table, I can get it to work on a regular worksheet.

Please help.

Thanks in advance.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


  #4   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default Worksheet change with pivot table

For Excel 2002 and later versions:

Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Format_Pivot_Table
End Sub


For earlier verions of Excel, you can use the Worksheet_Calculate event
to run the code.

Private Sub Worksheet_Calculate()
Format_Pivot_Table
End Sub


Richard wrote:
Debra, after reading your post I tried the Worksheet_PivotTableUpdate event.
I guess I don't know enough VBA to write it.

I have a macro I wish to run when the changes occur. The Macro name is
"Format_Pivot_Table".

Can you give me some direction on writing this?

Thanks in advanced.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
Conditional Formatting of Pivot Table Field jdanderson02 Excel Discussion (Misc queries) 2 February 9th 06 08:41 PM
Creating a Pivot Table with data in more than one worksheet Rehan Excel Worksheet Functions 1 December 6th 05 12:04 PM
can i use more than one worksheet in a pivot table ? Klutzz Excel Discussion (Misc queries) 2 November 30th 05 04:17 AM
pivot table created from another pivot table Kreed Excel Worksheet Functions 6 October 26th 05 04:16 PM
How do I use a pivot table value to reference a worksheet neoschenker Excel Worksheet Functions 10 January 20th 05 02:59 PM


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