Filter external data based on Named Ranged Criteria

greeman

New Member
Joined
Jul 31, 2005
Messages
38
I have a pivot table based on external data from an access database.
One of the fieds is period in "YYYMM" format.

I want to have the excel query filter the data based to <= based
on a "YYYYDD" enter in cell A1
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

XLGibbs

Well-known Member
Joined
Feb 25, 2005
Messages
2,446
You can edit the query and instead of leaving the criteria for that field blank, you can place a ? in the criteria for that column identifying it as a paramater.

When you first run the query you can enter any parameter you like, but you can then edit the query properties once back in excel and tell it to look at a cell on the sheet for the parameter (and also set it to auto-refresh if the value changes, or on file open etc)
 

greeman

New Member
Joined
Jul 31, 2005
Messages
38
Need more advice

Thanks for the help so far, buit I've gotten stuck.

How do I set the value in the query criteria to point to the cell. at present it simple says <="?"
 

XLGibbs

Well-known Member
Joined
Feb 25, 2005
Messages
2,446
You have to enclose the parameter in [ ] when first enteriing the criteria...

try
Code:
 <= [?]
[code]

I sent you an email with screen shots as well.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,625
Messages
5,832,748
Members
430,163
Latest member
YesImAk

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
Top