I have a macro which sorts a range but when the range is empty or for some other reason it gives an error. Is there anyway i can make this work..I am pasting the code below:
Application.Goto Reference:="DTHSORT2"
Range(ActiveCell, ActiveCell.Offset([SETCNT].Value, 0)).Select
ActiveWorkbook.Names.Add Name:="REPORTED", RefersToR1C1:=Selection
Application.Goto Reference:="REPORTED"
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Application.Goto Reference:="DATES"
Selection.Sort Key1:=Range("B1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Any Suggestions?
Any help would be very appriciated....
Thank you,
Navya
Application.Goto Reference:="DTHSORT2"
Range(ActiveCell, ActiveCell.Offset([SETCNT].Value, 0)).Select
ActiveWorkbook.Names.Add Name:="REPORTED", RefersToR1C1:=Selection
Application.Goto Reference:="REPORTED"
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Application.Goto Reference:="DATES"
Selection.Sort Key1:=Range("B1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Any Suggestions?
Any help would be very appriciated....
Thank you,
Navya