Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Coloring a datafield when nr of characters is more then 40 [email protected] Excel Programming 4 April 20th 09 02:29 PM
Pivot Table Calculated Datafield Caption Problem SaeOngJeeMa Excel Programming 2 February 12th 07 11:28 PM
Show and Hide in Datafield Fullam Excel Discussion (Misc queries) 0 April 17th 06 12:26 PM
Can I pull field as datafield or as a output from a pivot table re Vikram Dhemare Excel Discussion (Misc queries) 8 April 12th 06 04:57 AM
Finding Matching Pivot Datafield Todd Huttenstine Excel Programming 5 April 26th 04 09:26 PM


All times are GMT +1. The time now is 02:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"