mmn1000
Board Regular
- Joined
- Mar 17, 2020
- Messages
- 78
- Office Version
- 2019
- 2013
- Platform
- Windows
hi;
Friends, I have a problem with sorting numbers that I hope you can help me with.
I use the following code to sort the numbers:
This code of mine works correctly, but it does not do what I want it to do.
The above code moves the row when sorting, while I want only the numbers in column B to move and the other columns not to change at all.
Is this workable?
Friends, I have a problem with sorting numbers that I hope you can help me with.
I use the following code to sort the numbers:
VBA 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
The above code moves the row when sorting, while I want only the numbers in column B to move and the other columns not to change at all.
Is this workable?