Can a hidden formula effect the sorting process? I have a worksheet that I have written code to sort at a certain time. On the one page the sort works fine, but on another page that has several cells with hidden formulas the sort works differently. What I mean is, I sort from A6:C10 and A12:c40, on each page there are 6 cells at the bottom of my list that are blank, this is fine for the first page the sort sorts from cell A12 down leaving the blank ones at the bottom, but on the other page the 6 empty cells contain a hidden formula and when sorted the empty cells are moved to the top. Can I change this code to ignore the hidden formulas so that the empty cells are at the bottom on both pages?
Code:
Application.ScreenUpdating = False
Range("A6:C10").Select
Selection.Sort Key1:=Range("A6"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A13:C40").Select
Selection.Sort Key1:=Range("A13"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Code:
Application.ScreenUpdating = False
Range("A6:C10").Select
Selection.Sort Key1:=Range("A6"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A13:C40").Select
Selection.Sort Key1:=Range("A13"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom