When doing a adv filter its telling the The extract range has missing or illegal field name.

I had tried changing the macro to another module and when doing adv manually its working

Please help me in this matter.

Sub gp() Dim sh1 As Worksheet Dim sh2 As Worksheet Dim Reco As Worksheet Set sh1 = ActiveWorkbook.Sheets("As per Books") Set sh2 = ActiveWorkbook.Sheets("As per Govt Portal") Set Reco = ActiveWorkbook.Sheets("Reco") Dim rgdataGp As Range, rgcriteriaGp As Range, rgoutputGp As Range Dim LastRow As Long With Reco LastRow = .Cells(Rows.Count, 1).End(xlUp).Row End With Set rgdataGp = ThisWorkbook.Worksheets("As Per govt portal").Range("A7").CurrentRegion Set rgcriteriaGp = Reco.Range("M1").CurrentRegion Set rgoutputGp = Reco.Range("A" & LastRow).CurrentRegion rgdataGp.AdvancedFilter xlFilterCopy, rgcriteriaGp, rgoutputGp ThisWorkbook.Worksheets("Reco").Range("A1").CurrentRegion.ClearFormats ActiveWorkbook.Save End Sub 
5

Related questions 0 VBA Filtering - Getting Error 0 automation error with adding filter 2 VBA macro - AdvancedFilter method of Range class failed Related questions 0 VBA Filtering - Getting Error 0 automation error with adding filter 2 VBA macro - AdvancedFilter method of Range class failed 1 Adanced Filter VBA Issue 1 VBA Runtime Error 1004 the extract range has a missing or invalid field name 1 Excel VBA Auto Filter Error 4 Advanced filter error 1 Excel VBA - Auto FIlter and Advanced filter usage error 0 Excel VBA - Extract range is missing or illegal error on Range.AdvancedFilter 2 excel: run time error 1004 in advanced filter Load 7 more related questions Show fewer related questions

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.