I have a sheet with data in columns A thur F and the auto filter set on. In Column E (field 5) the sort is working well it filter all values as needed (I only wanted 0 selected). My problem is the next 2 sorts won’t work.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
I would like to have everything selected but 0 and blanks to be excluded. I need the order to be Column D (Field 4) then Column F (Field 6). Below is what I tried and failed.
<o> </o>
<o> </o>
Sub O_Use_StoLoc_Sheet_Macro()
'
' O_Use_StoLoc_Sheet_Macro Macro
'
ActiveSheet.Unprotect
Columns("A:F").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$F$40001").AutoFilter Field:=5, Criteria1:="0"
ActiveSheet.Range("$A$1:$F$40001").AutoFilter Field:=4, Criteria1:="<>"0, _
ActiveSheet.Range("$A$1:$F$40001").AutoFilter Field:=6, Criteria1:="<>"0, _
<o> </o>
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
<o> </o>
End Sub
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
I would like to have everything selected but 0 and blanks to be excluded. I need the order to be Column D (Field 4) then Column F (Field 6). Below is what I tried and failed.
<o> </o>
<o> </o>
Sub O_Use_StoLoc_Sheet_Macro()
'
' O_Use_StoLoc_Sheet_Macro Macro
'
ActiveSheet.Unprotect
Columns("A:F").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$F$40001").AutoFilter Field:=5, Criteria1:="0"
ActiveSheet.Range("$A$1:$F$40001").AutoFilter Field:=4, Criteria1:="<>"0, _
ActiveSheet.Range("$A$1:$F$40001").AutoFilter Field:=6, Criteria1:="<>"0, _
<o> </o>
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
<o> </o>
End Sub