Scripterklärung nötig
04.10.2003 22:13:36
Markus
jemand ausm forum hat mir den folgenden script gegeben:
Option Explicit
Sub Mischen()
Dim i As Byte, ii As Byte
On Error GoTo ErrorHandler:
Calculate
Application.Calculation = xlCalculationManual
For i = 1 To 3
For ii = 1 To 5
If Application.WorksheetFunction.Rank(Cells(ii, 5), Range("E1:E5")) = i Then
Cells(i, 2) = Cells(ii, 1)
Exit For
End If
Next ii
Next i
Range("C1") = Range("C1") + 1
Application.Calculation = xlCalculationAutomatic
ThisWorkbook.Save
Exit Sub
ErrorHandler:
MsgBox ("Fehler: Vermutlich sind nicht genügend Teilnehmer (min. 3) eingetragen.")
Application.Calculation = xlCalculationAutomatic
End Sub
____________________________________
jetzt meine frage, wie muß ich das umschreiben wenn aus den zellen B3:B7 drei leute in D3:D5 geschrieben werden sollen?
ich dachte ungefähr so:
Option Explicit
Sub Mischen()
Dim i As Byte, ii As Byte
On Error GoTo ErrorHandler:
Calculate
Application.Calculation = xlCalculationManual
For i = 3 To 5
For ii = 3 To 7
If Application.WorksheetFunction.Rank(Cells(ii, 5), Range("E1:E5")) = i Then
Cells(i, 2) = Cells(ii, 1) //hier is der knackpunkt.. denk ich
Exit For
End If
Next ii
Next i
Range("C1") = Range("C1") + 1
Application.Calculation = xlCalculationAutomatic
ThisWorkbook.Save
Exit Sub
ErrorHandler:
MsgBox ("Fehler: Vermutlich sind nicht genügend Teilnehmer (min. 3) eingetragen.")
Application.Calculation = xlCalculationAutomatic
End Sub
so gehts aber nicht.. thx 4 help