Hi All,
I am getting the strange error in executing the below code. Can Someone help.
Error Coming on .Apply Statement : Runtime Error 1004.
I am getting the strange error in executing the below code. Can Someone help.
Code:
Sheets("Data").Sort.SortFields.Clear
Sheets("Data").Sort.SortFields.Add Key:=Range("A9:H" & srtRng), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With Sheets("Data").Sort
.SetRange Range("A8:H" & srtRng)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Error Coming on .Apply Statement : Runtime Error 1004.