Ik heb een macro voor een kolom te sorteren, maar dit is precies enkel voor cijfers.
Momenteel is het zo, 1,2,3,4,7,2a,3a
Ik zou het zo moeten hebben: 1,2,2a,3,3a,4,7
Dit is mijn macro:
Momenteel is het zo, 1,2,3,4,7,2a,3a
Ik zou het zo moeten hebben: 1,2,2a,3,3a,4,7
Dit is mijn macro:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
On Error GoTo ErrHand
'If change was in col F, then sort col F ascending
If Target.Column = 4 Then
Set Rng = Range("A1:F" & Range("D65536").End(xlUp).Row)
Rng.Sort Key1:=Range("D1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End If
ErrHand:
Exit Sub
End Sub
Laatst bewerkt door een moderator: