I know this might be a silly question, but I can't seem to get around this error:
code:
Columns("B:B").Select
Sheets(1).Sort.SortFields.Clear
Sheets(1).Sort.SortFields.Add Key:=Range("B1"), SortOn:=xlSortOnValue, Order:=xlAscending, DataOption:=xlSortNormal
With Sheets(1).Sort
.SetRange Range("A1:G109585")
.Header = xlYes
.MatchCase = True
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Highlighted in red area is coming back (since I put option explicit at the top) saying variable not defined...???
How so?
code:
Columns("B:B").Select
Sheets(1).Sort.SortFields.Clear
Sheets(1).Sort.SortFields.Add Key:=Range("B1"), SortOn:=xlSortOnValue, Order:=xlAscending, DataOption:=xlSortNormal
With Sheets(1).Sort
.SetRange Range("A1:G109585")
.Header = xlYes
.MatchCase = True
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Highlighted in red area is coming back (since I put option explicit at the top) saying variable not defined...???
How so?