Hello,
I have been using this code to sort out a worksheet and pass the results to another sheet, and it works fine. But I was thinking of using this to sort another WS, except that I need to sort this one by two criteria's: column 7 is blank, but column 5 would not be blank. I am unsure of how to tweak the code to add in the second sorting action, all of the ways I tried have not worked. Is it possible to sort by two criteria's?
I appreciate any input - thanks,
I have been using this code to sort out a worksheet and pass the results to another sheet, and it works fine. But I was thinking of using this to sort another WS, except that I need to sort this one by two criteria's: column 7 is blank, but column 5 would not be blank. I am unsure of how to tweak the code to add in the second sorting action, all of the ways I tried have not worked. Is it possible to sort by two criteria's?
I appreciate any input - thanks,
VBA Code:
Dim rng As Range
With Sheets("Repair Log")
Set rng = .Range("A1:G" & .Range("A" & Rows.Count).End(xlUp).Row)
End With
With rng
.AutoFilter Field:=7, Criteria1:=""
.SpecialCells(xlCellTypeVisible).Copy
Sheets("Repair Report").Range("A1").PasteSpecial xlPasteValuesAndNumberFormats
Sheets("Repair Report").Cells.EntireColumn.AutoFit
End With