Advanced Filter. Fully Qualified Reference?

nigelk

Well-known Member
Joined
Aug 30, 2008
Messages
537
Hi all,

I have an advanced filter that gets it's data from one sheet (ImportSh) , its' criteria from another (ShtName) and puts the output to a third sheet (TempData)

This is the code I've got
Code:
ImportSh.Columns("E:L").AdvancedFilter Action:=xlFilterCopy, _
        CriteriaRange:=Sheets(ShtName).Range("A1:A2"), CopyToRange:=Sheets(TempData).Range("A1:H1") _
        , Unique:=False

But I get a 'type mismatch' error.
I'm thinking it's because its not fully qualified.

Can anyone help?
Thanks,Nigel
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Nigel

As far as I can see all the ranges are fully qualified.

Sometimes advanced filter can throw up some strange errors.

Have you checked all the data, criteria etc?

I've had this error, or similar, a few times and can remember at least once it seemed to have something to do with the destination worksheet.

It already had data on it and I think the headers didn't quite match with the original data.

I didn't think that would matter, and I don't know if it was the problem.

Anyway I just ended up using a temporary worksheet for an 'intermediate' destination and copying from that to the real destination.

Seemed to work and wasn't too much trouble.:)
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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