Forum Discussion

craygoza92's avatar
craygoza92
Copper Contributor
Jan 10, 2022
Solved

Range 99999?

Hello & good morning.    I've got the following code which sorts a file of shipments that vary in size every day.   Currently I'm using the following code:   ActiveSheet.Range("$A$1:W999999").A...
  • alannavarro's avatar
    alannavarro
    Jan 10, 2022

    craygoza92 

    Hello!

     

    Hope it works, instead of this line of code

    ActiveSheet.Range("$A$1:W999999").AutoFilter Field:=3, Criteria1:="*PF*"

     

    Try this one

    ActiveSheet.Range("A1", "W" & Cells(Rows.Count, 1).End(xlDown).Row).AutoFilter Field:=3, Criteria1:="*PF*"

Resources