Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings I have an Advance Filter VBA that is working fine, but I needed it more defined and it's not picking up the new elements I've added. The new Elements begin in Column J. I had to add these for sometimes I need multiple filter criteria. I have Macros that places those elements in the "Criteria Range" which runs from ("A1:Q13") I did tested the range by selecting Ctrl+Shift+8 and it selected around the within the Criteria Range. Why is this thing not using all the elements I've put in the Criteria Range. I know I can have multiple headers in filter using the same row? I know the macro below works. Thank you,
VBA Code:
Sub Manifest_Stndby_Filter()
Dim rgData As Range, rgCriteria As Range, rgOutput As Range
Dim sh As Worksheet
Dim LstRw As Long
Set rgData = ThisWorkbook.Worksheets("Database").Range("A15").CurrentRegion
Set rgCriteria = ThisWorkbook.Worksheets("Database").Range("A1").CurrentRegion
Set rgOutput = ThisWorkbook.Worksheets("Deficiencies").Range("A1")
Set sh = Sheets("Deficiencies")
With sh
LstRw = .Cells(.Rows.Count, "A").End(xlUp).row + 2
Set rgOutput = .Range("A" & LstRw)
rgData.AdvancedFilter xlFilterCopy, rgCriteria, rgOutput
End With
End Sub