Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding to a Pivot

I see many posts about 'Cleaning up a Pivot', but I want to do the opposite.

I often have the problem that I need to add data to a pivot table that isn't
there. A good example of this is states. I have reports that need to have
all the states to match up to other reports.

I first tried to add the states to the bottom and let the pivot grab them
with a zero count, but this adds (blank) to every field do to the extra
lines. While they can be hidden it is a little sloppy.

What I figured out was that if I copy all the states into the pivot range,
refresh the pivot, then copy the original states back, refresh again, the
pivot will hold onto those values. I now have a macro that does this,
tricking the pivot into holding on to values not really in the data range.

This works but is an extra step I would like to do away with. Does anyone
know of a way to add values to a pivot directly through vba?

Thanks,
--bnpatten


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding to a Pivot

I think you method is the safest way.

--
Regards,
Tom Ogilvy


"Bradford Patten" wrote in message
news:IbXeb.660973$Ho3.136695@sccrnsc03...
I see many posts about 'Cleaning up a Pivot', but I want to do the

opposite.

I often have the problem that I need to add data to a pivot table that

isn't
there. A good example of this is states. I have reports that need to have
all the states to match up to other reports.

I first tried to add the states to the bottom and let the pivot grab them
with a zero count, but this adds (blank) to every field do to the extra
lines. While they can be hidden it is a little sloppy.

What I figured out was that if I copy all the states into the pivot range,
refresh the pivot, then copy the original states back, refresh again, the
pivot will hold onto those values. I now have a macro that does this,
tricking the pivot into holding on to values not really in the data range.

This works but is an extra step I would like to do away with. Does anyone
know of a way to add values to a pivot directly through vba?

Thanks,
--bnpatten




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
Adding Line in Pivot Charts. GEM Excel Discussion (Misc queries) 1 July 30th 09 05:31 PM
Adding new data within Pivot Table Cydney Excel Discussion (Misc queries) 7 March 19th 08 08:35 PM
Adding two field into Pivot Table IF Statement[_2_] Excel Discussion (Misc queries) 0 November 21st 07 05:12 PM
Pivot Table Data Adding contents of two pivot tables and param que Roundy Excel Discussion (Misc queries) 0 July 2nd 07 10:20 PM
Adding a formula to a pivot table Tony Excel Discussion (Misc queries) 2 January 20th 05 10:27 AM


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"