jamescooper
Well-known Member
- Joined
- Sep 8, 2014
- Messages
- 840
Hello this code sorts B automatically from B2 downwards when a change is made.
How would I alter the code so that it only sorts B3 and down, so B1 the title of the column and B2 are constant. Tried a few alterations to the below without any success.
Thanks.
How would I alter the code so that it only sorts B3 and down, so B1 the title of the column and B2 are constant. Tried a few alterations to the below without any success.
Thanks.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("B:B")) Is Nothing Then
Range("B1").Sort Key1:=Range("B2"), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End Sub