Pivot Tables & Dates

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,653
Office Version
  1. 365
Platform
  1. Windows
I am having some trouble with a macro that manipulates a Pivot Table

The PT has a filter applied for a Week Commencing date
1733224943621.png


The code selects a week commencing date taken from a cell
1733224982893.png


The range referenced is formatted to a date format and is as below
1733225034770.png


I get the following when this tries to execute
1733225075056.png


I have tried with changing
VBA Code:
Format(Range("BCR_WC"), "dd/mm/yyyy")
to
VBA Code:
Format(Range("BCR_WC"), "mm/dd/yyyy")

Bu this messes up the filters available within the PT and add an additional option of "12/02/2024" which even upon a refresh, doesn't go away.

If I manually select the filter in the PT to the date and then run the code, that line executes with no error.

Anyone iwth an idea on how to fix?

TIA
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,226,464
Messages
6,191,182
Members
453,646
Latest member
BOUCHOUATA

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