[table="width: 500"]
[tr]
[td]Sub InsertRowAfterEachTrueInColumnL()
Dim R As Long, LastRow As Long
LastRow = Cells(Rows.Count, "L").End(xlUp).Row
For R = LastRow To 2 Step -1
If CBool(Cells(R - 1, "L").Value) = True Then Cells(R, "L").EntireRow.Insert
Next
End Sub[/td]
[/tr]
[/table]
Sub InsertRows()
With Range("L2", Range("L" & Rows.Count).End(xlUp))
.Replace False, "me", xlWhole, , , , False, False
.SpecialCells(xlConstants, xlLogical).Offset(1).EntireRow.Insert
.Replace "me", False
End With
End Sub
That code will not work correctly for multiple contiguous cells containing a TRUE value. To see this, put the following values in L1:L7 and run your code against it... all of the inserts will be applied to the first of the contiguous TRUE rows.If you're interested, here's a non looping approach
Code:Sub InsertRows() With Range("L2", Range("L" & Rows.Count).End(xlUp)) .Replace False, "me", xlWhole, , , , False, False .SpecialCells(xlConstants, xlLogical).Offset(1).EntireRow.Insert .Replace "me", False End With End Sub