Hello
I know this code below inserts blank rows based upon conditions.
Can someone please provide an explanation of this code?
Thank You
Monk
Dim Items As Integer
Dim TempCell As Excel.Range
Range("A2").Select
Do Until ActiveCell.Formula = ""
If ActiveCell.Formula = "BAL" Then
Items = 0
ActiveCell.Range("A2").Select
ElseIf UCase(Left(ActiveCell.Formula, 5)) = "CASE:" Then
Set TempCell = ActiveCell
If Items <> 15 Then
Rows(ActiveCell.Row & ":" & ActiveCell.Row + (14 - Items)).Select
Selection.Insert Shift:=xlDown
TempCell.Range("A2").Select
Else
ActiveCell.Range("A2").Select
End If
Else
Items = Items + 1
ActiveCell.Range("A2").Select
End If
Loop
I know this code below inserts blank rows based upon conditions.
Can someone please provide an explanation of this code?
Thank You
Monk
Dim Items As Integer
Dim TempCell As Excel.Range
Range("A2").Select
Do Until ActiveCell.Formula = ""
If ActiveCell.Formula = "BAL" Then
Items = 0
ActiveCell.Range("A2").Select
ElseIf UCase(Left(ActiveCell.Formula, 5)) = "CASE:" Then
Set TempCell = ActiveCell
If Items <> 15 Then
Rows(ActiveCell.Row & ":" & ActiveCell.Row + (14 - Items)).Select
Selection.Insert Shift:=xlDown
TempCell.Range("A2").Select
Else
ActiveCell.Range("A2").Select
End If
Else
Items = Items + 1
ActiveCell.Range("A2").Select
End If
Loop