PIVOT TABLE HIDE ITEM CODE HELP HELP

L

Legacy 55353

Guest
Hi,

I am having trouble writing 2 codes for 2 command buttons.

Code #1
The first code is to show only specific dates in a pivot table. I have a pivot table with dates from 1/1/04 to the current date. I need to turn on different date ranges every week. I.E. This week I need the dates from 12/10/05 to 12/18/05. I am looking for a code that will show only the dates including and between the dates of my range. Right now I have a begin date in cell A1 and an end date in cell A2. The pivot table item I am working with is called "Release Date" and I am looking for a code that will turn on the dates including and between the date in cell A1 and the date in cell A2. I would need to use this code for multiple pivot tables. I was using a call function but cannot figure out the right code.


Code #2 is probably more complicated.
Now I am working with 2 pivot table Items, i.e. "Release Date" and "Receipt Date." Both the release date and receipt date fields have a blank date "01/01/00" along with all the dates from 1/1/04.
I need this code to manipulate BOTH the release and receipt date fields.

FOR THE RELEASE DATE: I need the code to turn on only the blank date and anything after a certain date (usually the last friday). SO for today 12/28/05: I need only 01/01/00 and any date after 12/23/05 turned on.

FOR THE RECEIPT DATE: I need the code to turn on all the dates except the "01/01/00" and the days after 12/23/05 Friday. SO for today the dates that would be turned on would be all the dates from 01/01/04 to 12/23/05.

Again I am using this code for multiple pivots.

I can email you the file. I really appreciate any help. I have been trying to figure out the code for months. I can't find anything on the internet. Thank you. You can email me guitarfish222 at hotmail dot com and I can send you the file. Thanks again.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
You can emaiil me the file if you wish, I work with pivot tables frequently and can help

As far as the manipulation, you can record a macro which shows you the syntax for deselecting values within a data set from the drop down, or hide/unhide items from the page selection options.

Assuming your dates are contained in a date field, this should not be too problematic...if the dates are column headers themselves, then it would be amatter of showing or not showing the field itself...again, recording a macro can show you the syntax.

the code can only be re-used for multiple tables by referring to the table name as a variable, which can be identified any number of ways within the code, either using input boxes, checking the active sheet for pivot tables, or by referring to the name of the pivot table directly.

If you like, email me the file and I can see what I can do.
 
Upvote 0

Forum statistics

Threads
1,212,927
Messages
6,110,722
Members
448,294
Latest member
jmjmjmjmjmjm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top