this is my code
Sub SortMultipleColumns(myline As String)
With Worksheets("Result-Inactive").Sort
.SortFields.Add Key:=Range("A1"), Order:=xlAscending
.SortFields.Add Key:=Range("D1"), Order:=xlAscending
.SortFields.Add Key:=Range("J1"), Order:=xlAscending
.SetRange Range("A1:C" & myline)
.Header = xlYes
.Apply
End With
End Sub
I get the following error and I dont undertsand why "Run time error '1004' the sort reference is not valid. MAke sure that it is within the daya you want to sort, and then first Sort by Box isnt the same or blank. when I click debug. The .apply gets higlighted
any suggestions?
mylinehave when you're calling this?