Makro bleibt hängen
06.12.2006 16:49:12
Michael
könnt ihr euch mal mein Makro anschaun und sagen warum es hängen bleibt. Wenn ich das Makro teile und nacheinander ausführe, läuft alles Bestens.
Sub LeerZeilenKiller()
Dim i As Long, laR As Long
Application.ScreenUpdating = False
On Error Resume Next
laR = Cells.Find("*", Range("A26"), , , xlByRows, xlPrevious).Row
On Error GoTo 0
If laR > 0 Then
For i = 200 To 26 Step -1
If WorksheetFunction.CountA(Rows(i)) = 0 Or _
WorksheetFunction.CountIf(Rows(i), False) > 0 Then
Rows(i).Delete
End If
Next i
End If
Application.ScreenUpdating = True
Application.Run _
"'Wettbewerbsrechner10.3.2007 andere A-Liste.XLS'!Tabelle24.LeerZeilenKiller"
Range("A8").Select
ActiveCell.FormulaR1C1 = "=R[18]C"
Range("B8").Select
ActiveCell.FormulaR1C1 = "=R[18]C"
Range("G8").Select
ActiveCell.FormulaR1C1 = "=R[18]C"
Range("I8").Select
ActiveCell.FormulaR1C1 = "=R[18]C"
Range("J8").Select
ActiveCell.FormulaR1C1 = "=R[18]C"
Range("A8").Select
Selection.AutoFill Destination:=Range("A8:A12"), Type:=xlFillDefault
Range("A8:A12").Select
Range("B8").Select
Selection.AutoFill Destination:=Range("B8:B12"), Type:=xlFillDefault
Range("B8:B12").Select
Range("G8").Select
Selection.AutoFill Destination:=Range("G8:G12"), Type:=xlFillDefault
Range("G8:G12").Select
Range("I8").Select
Selection.AutoFill Destination:=Range("I8:I12"), Type:=xlFillDefault
Range("I8:I12").Select
Range("J8").Select
Selection.AutoFill Destination:=Range("J8:J12"), Type:=xlFillDefault
Range("J8:J12").Select
Range("H14").Select
Hab mal versucht mit Application.Wait (Now + TimeValue("0:00:01")) die Sache zu laufen zu brigen, ging leider auch nicht.
Kann mir jemand helfen ?
Mfg
Michael