Currently I am sorting data based on column B using. The data in column b is associated with data in column D. I want to add to the code below to sort by B and then within the sort on B sort on D.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("a2:n10000")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Me.sort.SortFields.Clear
Me.sort.SortFields.Add Key:=Range("b2:b10000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With Me.sort
.SetRange Range("A2:n10000")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.EnableEvents = True
End Sub
Bookmarks