• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

autofilter multiple columns is giving me a headache

ysherriff

Member
hello

I need someone help. I have the below autofilter in my code and for some reason it doesn't like the multiple conditions. I walked through the code by checking each criteria seperately and it works but together they do not. It filters the data but the informatino is blank. What possibly am I doing wrong. I even ran a test macro and used that information and it still did not work.

Thank you for your help. Here is the link if you need it.

https://www.dropbox.com/s/3ktvhdb2wpokgh2/Revenue Payout Calculation Q3-2014-08 V.06.zip

'filter the sheet and autofilter based on title and employee id
With ActiveSheet
.AutoFilterMode = False
.Range("DATA_REV_ACHV").AutoFilter Field:=NTID, Criteria1:=NTID
.Range("DATA_REV_ACHV").AutoFilter Field:=IncentiveTitleINDEX, Criteria1:="PSR"

End With

Set tbl = Range("a3").CurrentRegion
tbl.Offset(1, 0).Resize(tbl.Rows.Count - 1, tbl.Columns.Count).Select
Selection.Copy
 
Thank you. I have the column number tagged in public constant. here is the public constant code: I will try to extract a sample data size.

Public Const calcOuputFilePath = "S:\Monthly Revenue Achievement" ' Rev Achievement location
Public Const strPSRTemplate = "Monthly Revenue Achievement Template.xls" ' PSR template location
Public Const strLeadersTemplate = "Leaders Revenue Calculator Template.xls" ' Leaders location
Public Const leadersNTIDINDEX = 1
Public Const IncentiveTitleINDEX = 3
Public Const NTIDINDEX = 1



and here is the filter code again

'filter the sheet and autofilter based on title and employee id
With ActiveSheet
.AutoFilterMode = False
.Range("DATA_REV_ACHV").AutoFilter Field:=NTID, Criteria1:=NTID
.Range("DATA_REV_ACHV").AutoFilter Field:=IncentiveTitleINDEX, Criteria1:="PSR"

End With



Set tbl = Range("a3").CurrentRegion
tbl.Offset(1, 0).Resize(tbl.Rows.Count - 1, tbl.Columns.Count).Select
Selection.Copy
 
this is the reason why debugging is so important... my data range field includes the header....that was the issue...

unbelievable........


tjhanks for your help
 
Back
Top