Danke für die Hilfe, klappt aber bei mir nicht. Der Fehler ist immer noch, dass die Sort-Methode des Range-Objektes...
Hier mal mein Testscript: (mit Biene Maja damit man nicht soviel tippen muss
)
Dim Arr1(1 To 10) As String
Dim Arr2(1 To 10) As String
Dim Arr3(1 To 10) As String
Arr1(1) = "Willi"
Arr1(2) = "Willi"
Arr1(3) = "Maja"
Arr1(4) = "Willi"
Arr1(5) = "Willi"
Arr1(6) = "Maja"
Arr1(7) = "Willi"
Arr1(
= "Willi"
Arr1(9) = "Maja"
Arr1(10) = "Willi"
Arr2(1) = "Biene"
Arr2(2) = "Hummel"
Arr2(3) = "Biene"
Arr2(4) = "Hummel"
Arr2(5) = "Biene"
Arr2(6) = "Hummel"
Arr2(7) = "Biene"
Arr2(
= "Biene"
Arr2(9) = "Biene"
Arr2(10) = "Berta"
Arr3(1) = "5"
Arr3(2) = "3"
Arr3(3) = "7"
Arr3(4) = "6"
Arr3(5) = "8"
Arr3(6) = "4"
Arr3(7) = "3"
Arr3(
= "2"
Arr3(9) = "1"
Arr3(10) = "0"
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
For s = 1 To 10
objsheet.Cells(s, 1).Value = arr1(s)
Next
For s = 1 To 10
objsheet.Cells(s, 2).Value = arr2(s)
Next
For s = 1 To 10
objsheet.Cells(s, 3).Value = arr3(s)
Next
objSheet.Cells.Select 'Gesamtes Arbeitsblatt markieren
objExcel.Selection.Sort objSheet.Columns("A"), xlAscending , "", objSheet.Columns("B"), xlAscending , objSheet.Columns("C"), xlAscending, xlGuess,1, False, xlTopToBottom
Findet jemand den Fehler?
CPO