Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Seeting up repetitive code
I want to repeat this code:
ActiveSheet.PivotTables("PivotTable1").PivotFields ("Month").CurrentPage = in multiple macros...how would I do it? This is my thought thus far but I'm not sure about the syntax: Dim repeat As String repeat = ActiveSheet.PivotTables("PivotTable1").PivotFields ("Month").CurrentPage = _ If Range("T6").Value = "2" repeat&"January_2006" end if If Range("T6").Value = "3" repeat&"February_2006" end if etc. etc. - any suggestions? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Seeting up repetitive code
Maybe something like this?
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Month") Select Case Range("T6") Case 2 .CurrentPage = "January" Case 3 .CurrentPage = "February" Case Else .CurrentPage = "Whatever" End Select End With -- Charles Chickering "A good example is twice the value of good advice." "Matt" wrote: I want to repeat this code: ActiveSheet.PivotTables("PivotTable1").PivotFields ("Month").CurrentPage = in multiple macros...how would I do it? This is my thought thus far but I'm not sure about the syntax: Dim repeat As String repeat = ActiveSheet.PivotTables("PivotTable1").PivotFields ("Month").CurrentPage = _ If Range("T6").Value = "2" repeat&"January_2006" end if If Range("T6").Value = "3" repeat&"February_2006" end if etc. etc. - any suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Repetitive Numbers | Excel Discussion (Misc queries) | |||
Repetitive keystroke | Excel Discussion (Misc queries) | |||
repetitive | Excel Discussion (Misc queries) | |||
Repeat Code Repetitive Actions? | Excel Discussion (Misc queries) | |||
Need a simple VBA code to automate a repetitive task. | Excel Programming |