![]() |
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 |
All times are GMT +1. The time now is 08:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com