I am trying to have data I enter in Col B (300 lines) auto sort Hig to low and can't seem to get it to work. Any Ideas?
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B1:B300")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Me.Sort.SortFields.Clear
Me.Sort.SortFields.Add Key:=Range("B1:B300"), SortOn:=xlSortOnValues, Order:=xlDecending, DataOption:=xlSortNormal
With Me.Sort
.SetRange Range("B1:B300")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B1:B300")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Me.Sort.SortFields.Clear
Me.Sort.SortFields.Add Key:=Range("B1:B300"), SortOn:=xlSortOnValues, Order:=xlDecending, DataOption:=xlSortNormal
With Me.Sort
.SetRange Range("B1:B300")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.EnableEvents = True
End Sub