I have a spreadsheet we are always updating with new data. I need to sort column "H" first and then column "G" second. They are numerical. I have tried using this code but get runtime error 1004. I am a newbie so please help.
Sub sort2columns()
With Sheets("OP")
LastRow = .Range("H" & .Rows.Count).End(xlUp).Row
LastRow = .Range("G" & .Rows.Count).End(xlUp).Row
End With
Range("H2:H" & LastRow).Sort key1:=Range("H2:H" & LastRow), order1:=xlAscending, Header:=xlNo
Range("G2:G" & LastRow).Sort key2:=Range("G2:G" & LastRow), order2:=xlAscending, Header:=xlNo
End Sub