Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I build a report in Excel with a month-selector. What I want to achieve is that if a different month is selected the macro will be runned automatically. The macro will update two pivots using the commands below: ActiveSheet.PivotTables("PivotTable2").PivotCache. Refresh ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh Tips are very welcome :) Thanx, Mike -- Le_requin ------------------------------------------------------------------------ Le_requin's Profile: http://www.excelforum.com/member.php...o&userid=14831 View this thread: http://www.excelforum.com/showthread...hreadid=264635 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you select a different month by changing a value in a cell (or selecting
a month from a validation dropdown in xl2000 or later) (assumes the pivot tables are on the same sheet as the cell with the month) Assume the cell is B9 Private Sub Worksheet_Change(ByVal Target As Range) if Target.count 1 then exit sub if isempty(target) then exit sub if Target.Address = "$B$9" then ActiveSheet.PivotTables("PivotTable2").PivotCache. Refresh ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh End if End Sub -- Regards, Tom Ogilvy "Le_requin" wrote in message ... Hi, I build a report in Excel with a month-selector. What I want to achieve is that if a different month is selected the macro will be runned automatically. The macro will update two pivots using the commands below: ActiveSheet.PivotTables("PivotTable2").PivotCache. Refresh ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh Tips are very welcome :) Thanx, Mike -- Le_requin ------------------------------------------------------------------------ Le_requin's Profile: http://www.excelforum.com/member.php...o&userid=14831 View this thread: http://www.excelforum.com/showthread...hreadid=264635 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Starting Auto_Close macro based on an IF statement | Excel Discussion (Misc queries) | |||
Getting macro to copy to starting cell | Excel Worksheet Functions | |||
How can I assign a range starting cell based on a variable locati. | Excel Discussion (Misc queries) | |||
How can I assign a range starting cell based on a variable locati. | Excel Worksheet Functions | |||
Verify starting cell for macro | Excel Programming |