Pivot Table Date Field Filter

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,651
Office Version
  1. 365
Platform
  1. Windows
Within a worksheet (see image below) the selected cell of B4 has the named range of BCR_WC and a date value of 27 Jan 25 is in the cell.

This cell is formatted to a date value.

1737365069558.png



I have code the manipulates a pivot table to change a filter to the above week commencing date.

1737365028587.png


The above is returning an error when the filter is set to (All)
1737365208168.png


When I manually change the filter to the date in the BCR_WC cell (27 Jan 25), this code executes.

Not entirely sure why the date value isn't translating to the VBA code and PT manipulation.

TIA
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
using the DateValue function to convert the 'text' date to a date value works

VBA Code:
DateValue(Format(Range("BC_WC"), "dd/mm/yyyy"))
 
Upvote 0
Solution

Forum statistics

Threads
1,225,738
Messages
6,186,725
Members
453,368
Latest member
positivemind

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