Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is it possible to add variables to a pivot datafield name?
Hello,
I am tring to get the user to input the abbreviation for the month they would like to pivot on, assign it to a variable, and use it to identify which datafield to select. * PivMonth = InputBox(prompt:="Please enter the abbreviation for the month you would like to see in your pivot table. (ex. Dec)") Set WIPcache = WB.PivotCaches.Add(SourceType:=xlDatabase, SourceData:=PivRng.Address) Set WIPpiv = WIPcache.CreatePivotTable(Tabledestination:=Piv.Ra nge("A3"), Tablename:="PivWIP") With WIPpiv.PivotFields("Program ID") .Orientation = xlRowField End With * ActiveSheet.PivotTables("PivWIP").AddDataField ActiveSheet.PivotTables("PivWIP" _ ).PivotFields(PivMonth & "USD"), xlSum Thank you, Wes |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Coloring a datafield when nr of characters is more then 40 | Excel Programming | |||
Pivot Table Calculated Datafield Caption Problem | Excel Programming | |||
Show and Hide in Datafield | Excel Discussion (Misc queries) | |||
Can I pull field as datafield or as a output from a pivot table re | Excel Discussion (Misc queries) | |||
Finding Matching Pivot Datafield | Excel Programming |