Hello
I have a worksheet with data in it and I would like to extract the applicable rows when the criteria of anything being in Column I OR anything being in Column J OR anything being in Column K.
The code below doesn't yield any cases because I assume it is looking for when all 3 criteria are met and there are zero cases where all 3 meet. I tested it by adding something in all columns for a few rows and they were picked up. So how do I get this to be "or" instead of "and":
Thanks for any and all assistance.
I have a worksheet with data in it and I would like to extract the applicable rows when the criteria of anything being in Column I OR anything being in Column J OR anything being in Column K.
The code below doesn't yield any cases because I assume it is looking for when all 3 criteria are met and there are zero cases where all 3 meet. I tested it by adding something in all columns for a few rows and they were picked up. So how do I get this to be "or" instead of "and":
Code:
Sub Triage_Data()
Dim ws As Worksheet
If worksheetexists("Triage_Data") Then
MsgBox "Worksheet already exists - need to delete it first"
Else
With Sheets("HDM_Values")
.AutoFilterMode = False
With .Range("A2:AA2")
.AutoFilter
.AutoFilter Field:=9, Criteria1:="<>"
.AutoFilter Field:=10, Criteria1:="<>"
.AutoFilter Field:=11, Criteria1:="<>"
End With
.AutoFilter.Range.Copy Destination:= _
Sheets.Add.Cells(Rows.Count, 1).End(xlUp)(2, 1)
.AutoFilterMode = False
End With
Set ws = ActiveSheet
ws.Name = "Triage_Data"
End If
End Sub
Thanks for any and all assistance.