Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running a macro
Can anyone tell me how to initiate the following procedures when a user changes a field buttong in a pivot chart? The following are macros in a module that I need to run if "Under 50 Stores", "50 to 200 Stores", or "Over 200 Stores" is selected from the field button of the chart: ------------------------------------------------- Sub Format_Under_50_Stores() ActiveChart.PivotLayout.PivotTable.PivotFields("Ra nge").CurrentPage = _ "Under 50 Stores" ActiveChart.SeriesCollection("Under 50 Stores").Select With Selection.Border ..ColorIndex = 1 ..Weight = xlThick ..LineStyle = xlContinuous End With With Selection ..MarkerBackgroundColorIndex = xlNone ..MarkerForegroundColorIndex = xlNone ..MarkerStyle = xlNone ..Smooth = True ..MarkerSize = 5 ..Shadow = False End With ActiveChart.Deselect End Sub Sub Format_50_to_200_Stores() ActiveChart.PivotLayout.PivotTable.PivotFields("Ra nge").CurrentPage = _ "50 to 200 Stores" ActiveChart.SeriesCollection("50 to 200 Stores").Select With Selection.Border ..ColorIndex = 1 ..Weight = xlThick ..LineStyle = xlContinuous End With With Selection ..MarkerBackgroundColorIndex = xlNone ..MarkerForegroundColorIndex = xlNone ..MarkerStyle = xlNone ..Smooth = True ..MarkerSize = 5 ..Shadow = False End With ActiveChart.Deselect End Sub Sub Format_Over_200_Stores() ActiveChart.PivotLayout.PivotTable.PivotFields("Ra nge").CurrentPage = _ "Over 200 Stores" ActiveChart.SeriesCollection("Over 200 Stores").Select With Selection.Border ..ColorIndex = 1 ..Weight = xlThick ..LineStyle = xlContinuous End With With Selection ..MarkerBackgroundColorIndex = xlNone ..MarkerForegroundColorIndex = xlNone ..MarkerStyle = xlNone ..Smooth = True ..MarkerSize = 5 ..Shadow = False End With ActiveChart.Deselect End Sub -- tobriant ------------------------------------------------------------------------ tobriant's Profile: http://www.excelforum.com/member.php...o&userid=25155 View this thread: http://www.excelforum.com/showthread...hreadid=481959 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Event Macro running another macro inside | Excel Discussion (Misc queries) | |||
disable user running macro from Tools Macro | Excel Discussion (Misc queries) | |||
how to get onkey macro to fire while another macro is running | Excel Programming | |||
running a macro ina workbook that doesnt have that macro | Excel Programming | |||
Launch Macro in Access via Macro running in Excel??? | Excel Programming |