Gruppe
Allgemein
Problem
Wie kann ich die Werte in mehreren Spalten sortieren?
StandardModule: basMain
Sub MultiSort()
Dim iCol As Integer, iRow As Integer, iRowT As Integer
For iCol = 1 To 2
iRow = 1
Do Until IsEmpty(Cells(iRow, 1))
iRowT = iRowT + 1
Cells(iRowT, 27).Value = Cells(iRow, iCol).Value
iRow = iRow + 1
Loop
Next iCol
Range("AA1").CurrentRegion.Sort _
key1:=Range("AA1"), order1:=xlAscending
iRowT = 0
For iCol = 1 To 2
iRow = 1
Do Until IsEmpty(Cells(iRow, 1))
iRowT = iRowT + 1
Cells(iRow, iCol).Value = Cells(iRowT, 27).Value
iRow = iRow + 1
Loop
Next iCol
Columns("AA").ClearContents
End Sub