Macro to select date field from Pivot Table --- PLease HELP

ccofmars

New Member
Joined
May 20, 2010
Messages
44
Hi I am using Excel 2010. My level of VBA is below novice and I need some help creating a macro that will prompt a message box asking to type of date and that consequently only select the date in the pivot table.

It is an attendance report that I am building.
I have already created a button that prompts a macro to refresh the pivot.
I need a macro that will prompt the user to type of date (message box) and that will select the date typed in the pivot to show the employees that are present or absent on that date.

please help!:pray::pray:

I thank you in advance.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi Derek

It is an excellent start. that was exactly what I was looking for. However, I have having an issue due to the fact that I do not have a column "Date".

I have a index match and to make a long story short, my columns are as follows:


-- removed inline image ---
Sites | Modality | Employees | 1-Sep | 2-sep | 3-Sep | etc....

I tried to change things around in the macro to make it work, but I was unsuccessful :banghead:

I do not know how to check and uncheck fields in the pivot via macro.

your help is greatly appreciated... I am also there thanks to your help though.
 
Last edited:
Upvote 0
You mentioned 'date' in your post (I guess that you meant 'data') which is why I pointed you at that particular page.
Have a look at PT0013 (Filter From Worksheet Selection) on that same page - that does the filtering for one field (in the example) by setting up a true or false column that can be filtered in the pivot table, instead of using VBA.
You are using Excel 2010 - have you looked at 'Slicers'?
You will be able to watch an example at:
http://www.youtube.com/watch?v=KG593BIWV7U
 
Upvote 0
WOW... thanks for the info as I did not know what a slicer was. It was definitely informative for my next project. Regarding the report I am building, it does not work as I am getting "slices" of each date. I did mean Date (not data). I wish I could attach a picture at what I am looking at since the description of my pivot table is not very clear.

What I am trying to accomplish is have a macro prompting a message box that request the user to type a date, the date would then be "checked" in the fields list of the pivot table.

Again thank you so much for providing feedback.
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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