AW: Fortschrittsanzeige in Formular
29.11.2006 19:23:33
roland_k
hallo rainer,
hier ist der ganze code....dessen ablauf angezeigt werden soll
Private Sub CommandButton1_Click()
frage = MsgBox("willst du spieler von hand setzen?", vbYesNo)
If frage = vbYes Then
MsgBox "klicke auf einen Namen links in der namensspalte"
Exit Sub
End If
UserForm1.Show
UserForm1.Repaint
Application.ScreenUpdating = False
anztisch = Cells(6, 1) + Cells(9, 1) 'Platz 1
For i = 1 To anztisch * 2 Step 2
loss = Range("E42").End(xlUp).Row - 2
iloss = (Int(loss * Rnd) + 1)
If Cells(4 + i, 11) <> "" Then GoTo weiter1
Cells(4 + i, 11) = Cells(iloss + 2, 3)
Cells(4 + i, 11).Interior.ColorIndex = 4
Cells(4 + i, 10).Interior.ColorIndex = 4
Cells(iloss + 2, 3).ClearContents
Cells(iloss + 2, 4).ClearContents
Cells(iloss + 2, 5).ClearContents
sortieren.sort_nach_S
'MsgBox Cells(4 + i, 11)
weiter1:
Next i
For i = 1 To anztisch * 2 Step 2 'Platz 2
loss = Range("C42").End(xlUp).Row - 2
iloss = (Int(loss * Rnd) + 1)
If Cells(4 + i, 12) <> "" Then GoTo weiter2
Cells(4 + i, 12) = Cells(iloss + 2, 3)
Cells(4 + i, 12).Interior.ColorIndex = 4
Cells(iloss + 2, 3).ClearContents
Cells(iloss + 2, 4).ClearContents
Cells(iloss + 2, 5).ClearContents
sortieren.sort_nach_Namen
'MsgBox Cells(4 + i, 12)
weiter2:
Next i
For i = 1 To anztisch * 2 Step 2 'Platz3
loss = Range("C42").End(xlUp).Row - 2
iloss = (Int(loss * Rnd) + 1)
If Cells(4 + i, 13) <> "" Then GoTo weiter3
Cells(4 + i, 13) = Cells(iloss + 2, 3)
Cells(4 + i, 13).Interior.ColorIndex = 4
Cells(iloss + 2, 3).ClearContents
Cells(iloss + 2, 4).ClearContents
Cells(iloss + 2, 5).ClearContents
sortieren.sort_nach_Namen
'MsgBox Cells(4 + i, 13)
weiter3:
Next i
For i = 1 To anztisch * 2 Step 2 'Platz4
loss = Range("C42").End(xlUp).Row - 2
iloss = (Int(loss * Rnd) + 1)
If Cells(4 + i, 14) <> "" Then GoTo weiter4
Cells(4 + i, 14) = Cells(iloss + 2, 3)
Cells(4 + i, 14).Interior.ColorIndex = 4
Cells(iloss + 2, 3).ClearContents
Cells(iloss + 2, 4).ClearContents
Cells(iloss + 2, 5).ClearContents
sortieren.sort_nach_Namen
'MsgBox Cells(4 + i, 14)
weiter4:
Next i
CommandButton1.Visible = False
CommandButton2.Visible = True
Application.ScreenUpdating = True
Unload UserForm1
End Sub
Private Sub CommandButton2_Click()
MsgBox "alles erledigt gehe auf tabelle Start"
End Sub
Private Sub Worksheet_Activate()
Dim zeile As Integer
Dim spalte As Integer
Dim zelle As Range
Sheets("Tische").Range("K4:N23").ClearContents
Sheets("Tische").Range("J4:N23").Interior.ColorIndex = 15
CommandButton1.Visible = True
CommandButton2.Visible = False
Range("C3:E42").ClearContents
Cells(3, 1) = ""
Cells(6, 1) = ""
Cells(9, 1) = ""
With Sheets("Start")
Cells(3, 1) = .Cells(3, 11)
Cells(6, 1) = .Cells(9, 11)
Cells(9, 1) = .Cells(15, 11)
For zeile = 3 To 22
For spalte = 3 To 7 Step 4
Set zelle = .Cells(zeile, spalte)
If zelle.Interior.ColorIndex = 4 Then
If spalte = 3 Then
Cells(zeile, 3) = zelle
Cells(zeile, 4) = .Cells(zeile, spalte + 1)
Cells(zeile, 5) = .Cells(zeile, spalte + 2)
Else
Cells(zeile + 20, 3) = zelle
Cells(zeile + 20, 4) = .Cells(zeile, spalte + 1)
Cells(zeile + 20, 5) = .Cells(zeile, spalte + 2)
End If
End If
Next spalte
Next zeile
Set zelle = Nothing
End With
sortieren.sort_nach_S
End Sub
ich hoffe ....kannst mir da helfen ?
gruss roland_k