Option Explicit
Sub SortStuff()
Dim LR As Long, piRow As Long, CERow As Long, VOSRow As Long
Dim ws As Worksheet
Dim rng As Range
Set ws = Sheets("Sheet1")
With ws
LR = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
piRow = .Columns("A").Find(what:="P1 Level Calls", LookIn:=xlValues, lookat:=xlWhole).Row
CERow = .Columns("A").Find(what:="Vendor CE Meet", LookIn:=xlValues, lookat:=xlWhole).Row
VOSRow = .Columns("A").Find(what:="Vendor On Site", LookIn:=xlValues, lookat:=xlWhole).Row
Set rng = .Range(.Cells(piRow + 1, 1), .Cells(CERow - 5, "R"))
With rng
If rng.Rows.Count > 1 Then
.Sort Key1:=.Cells(piRow + 1, "J"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End If
End With
Set rng = .Range(.Cells(CERow + 1, 1), .Cells(VOSRow - 1, "R"))
With rng
If rng.Rows.Count > 1 Then
.Sort Key1:=.Cells(CERow + 1, "J"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End If
End With
Set rng = .Range(.Cells(VOSRow + 1, 1), .Cells(LR, "R"))
With rng
If rng.Rows.Count > 1 Then
.Sort Key1:=.Cells(VOSRow + 1, "J"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End If
End With
End With
End Sub
Bookmarks