Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Pivot table to launch Macro


HI All,

No solution yesterday - can anyone help...

Once a person has made a selection on the page header part of a pivot
table, a need to call a macro that fixes formatting and the like of
other parts of the table.
(removing auto format table or preserve format under table options
doesnt work, I need to be able to call a macro.

Any suggestions welcome

Thanks

D


*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Pivot table to launch Macro

Hi Darin,

The worksheet calculate event fires when a pivot table changes. You can
launch your macro from that.

Place this code in the module for the worksheet that contains the pivot.

Private Sub Worksheet_Calculate()
call your_macro
End Sub

This will launch every time a calculation is made on that sheet. So, you
macro will run with any change in the pivot - not just page headers.

Regards,
Mike

"Darin Kramer" wrote:


HI All,

No solution yesterday - can anyone help...

Once a person has made a selection on the page header part of a pivot
table, a need to call a macro that fixes formatting and the like of
other parts of the table.
(removing auto format table or preserve format under table options
doesnt work, I need to be able to call a macro.

Any suggestions welcome

Thanks

D


*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Pivot table to launch Macro

In Excel 2002 and later versions, there's a PivotTableUpdate event that
you could use.

If you're using an older version, you can use the Worksheet_Calculate
event, as Mike suggested.

Also, in older versions, when you're selecting cells to format, use the
Pivot Table selection, instead of selecting cells with the Excel
pointer. You may have to Enable Selection first. (From the Pivot
toolbar, choose PivotTableSelect, and click on Enable Selection)

Then, before formatting cells, use the selection feature to select the
cells. For example, move the pointer to the top of a column in the pivot
table (just above the column's heading cell). When the black arrow
appears (like the one that appears when the pointer is over a column
button), click to select the column in the pivot table.

Or, use the commands on the Pivot TableSelect menu, e.g. select the
entire table, then choose to Select Data.

Then apply the formatting, and it may stick.


Darin Kramer wrote:
HI All,

No solution yesterday - can anyone help...

Once a person has made a selection on the page header part of a pivot
table, a need to call a macro that fixes formatting and the like of
other parts of the table.
(removing auto format table or preserve format under table options
doesnt work, I need to be able to call a macro.

Any suggestions welcome

Thanks

D


*** Sent via Developersdex http://www.developersdex.com ***



--
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
Pivot table to launch Macro Darin Kramer Excel Programming 3 August 24th 05 03:55 PM
Macro launch - Button vs Manual launch , has different results. Wayne Excel Programming 4 February 23rd 05 11:33 AM
Can you use an IF statement to launch a macro? ian123[_34_] Excel Programming 3 January 3rd 04 12:38 AM
auto-launch a MACRO? d-cubed Excel Programming 4 December 22nd 03 10:10 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


All times are GMT +1. The time now is 05:52 PM.

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"