Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings,
I have the following vba and it works find; however after the macro is activated it leaves the first column A selected. Is there something I can do, to remove the appearance of it being selected.
The VBA is:
Thank you very much indeed.
I have the following vba and it works find; however after the macro is activated it leaves the first column A selected. Is there something I can do, to remove the appearance of it being selected.
The VBA is:
VBA Code:
Sub AoutboundSort()
'
' AoutboundSort
''
Columns("A:A").Select
ActiveWorkbook.Worksheets("Air Outbound").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Air Outbound").Sort.SortFields.Add2 Key:=Range _
("A1:A1048576"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Air Outbound").Sort
.SetRange Range("A1:A1048576")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.RefreshAll
End Sub
Thank you very much indeed.