PC Review


Reply
Thread Tools Rate Thread

Automatic GETPIVOTDATA formula generation from within VBA?

 
 
John Brock
Guest
Posts: n/a
 
      26th Jun 2008
If I have a pivot table and I want a formula outside of the table
to refer to one of the table values, I just type "=" and click on
the pivot cell, and Excel automatically generates the appropriate
GETPIVOTDATA(...) formula. This is very convenient (and I know
how to turn the feature off if necessary).

But what if I want to do the same thing from within VBA? Recording
a macro I see something like:

ActiveCell.FormulaR1C1 = "=GETPIVOTDATA(""Data_Field"",R13C26,""Field_1"",""Value_1"",...)"

Conceptually this is easy, but in practice constructing all the
formula strings I'm going to need is going to be a pain. Is there
any way I can ask Excel to construct a GETPIVOTDATA formula
automatically by specifying the cell, the way it works when I do
it by hand?
--
John Brock
(E-Mail Removed)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic GETPIVOTDATA formula generation from within VBA? John Brock Microsoft Excel Programming 0 26th Jun 2008 05:27 AM
How to disable the automatic getpivotdata function in excel? joepots@gmail.com Microsoft Excel Worksheet Functions 0 6th Sep 2007 01:54 PM
How to disable the automatic getpivotdata function in excel? joepots@gmail.com Microsoft Excel Worksheet Functions 0 6th Sep 2007 01:54 PM
Why when I click on a pivot, form Getpivotdata isn't automatic =?Utf-8?B?SkI=?= Microsoft Excel Misc 1 11th Oct 2006 05:19 PM
Is there any way to disable the "getpivotdata" automatic formula? =?Utf-8?B?QkdO?= Microsoft Excel Worksheet Functions 2 2nd Sep 2005 01:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:09 PM.