Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Return value from a pivot table

I have a pivot table that looks something like this:

Product1 Product2 Product3
Week1 2500 500 0
Week2 200 35 800
Week3 150 5000 3

Where the numbers are quantities of their corresponding product required by
week. In my current code I have variables that contain the column name and
the row name (i.e. varProduct and varWeek). How do I get the value of the
quantity that corresponds to the variables?

Thanks!
--

-------JKY<-------


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Return value from a pivot table

Joseph K. Young wrote:
In my current code I have variables that contain the column name and
the row name (i.e. varProduct and varWeek). How do I get the value of the
quantity that corresponds to the variables?


One way would be to use the worksheet GETPIVOTDATA function.

V = Application.Evaluate("GETPIVOTDATA(Sheet4!A1,""" & varProduct & " " &
varWeek & """)")

where you would replace Sheet4!A1 with the address (or range name) of a cell
in your pivot table.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

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
Need pivot table data to return the value rather than sum, count, VelvetVoice Charts and Charting in Excel 0 March 19th 09 02:08 PM
Pivot Table: Return Value From Same Row Sean Smart Excel Discussion (Misc queries) 5 March 19th 08 05:38 AM
Using a Pivot Table to return top entries only dan Excel Discussion (Misc queries) 1 August 14th 06 12:25 PM
Pivot Table: Compunding Return instead of Adding it? [email protected] Excel Discussion (Misc queries) 0 January 20th 06 10:54 PM
how do I make hard carriage return appear in pivot table? colebill1997 Excel Discussion (Misc queries) 1 September 28th 05 01:56 PM


All times are GMT +1. The time now is 02:57 AM.

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"