Sub TEST()
Dim liZeile As Long
Dim liZeileMax As Long
.
Dim blnInsert As Boolean
liZeileMax = Cells(Rows.Count, 1).End(xlUp).Row
For liZeile = 1 To liZeileMax
If Range("A" & liZeile).Interior.ColorIndex = 42 Then
If Range("B" & liZeile).Text = "" Then
Exit For
Else
blnInsert = True
End If
End If
Next
'If liZeile > liZeileMax Then
' Call MsgBox("nichts gefunden", vbExclamation)
'Exit Sub
'End If
If blnInsert = True Then Call Rows(liZeile).EntireRow.Insert(CopyOrigin:=xlFormatFromLeftOrAbove)
Cells(liZeile, "B").Value = "Test59"
Cells(liZeile, "C").Value = "TestC"
Cells(liZeile, "D").Value = "TestD"
Cells(liZeile, "E").Value = "TestE"
End Sub
...so funktioniert es! bei
If blnInsert Then Call
fehlte das "=True"!
Also vielen Dank für deine/ eure(?) Hilfe.
vg vanderstorm
|