Trying to create a better vba code for creating an outline.

Based on the number in column "E", the code should indent (group) rows. If the number is 3, then indent once. If the number is 4, then indent twice. If the number is 5, then indent three times. Numbers in column "E" could go up to 12. I think the solution should use Selection.Rows.Group (N-2)x "Number in column E minus 2 times". Is this possible? The code below is very lazy, but I just don't know how to group more than once without recirculating through the whole worksheet.

Thanks in advance!


Sub Indent()
' Indent Macro
' Indent WBS
Dim LR As Long
Application.ScreenUpdating = False
LR = Range("E" & Rows.Count).End(xlUp).Row

Range("E" & LR).Select
Do Until ActiveCell.Row = 2
If ActiveCell.Value > 2 Then
Selection.Rows.Group
End If
ActiveCell.Offset(-1).Select
Loop

Range("E" & LR).Select
Do Until ActiveCell.Row = 2
If ActiveCell.Value > 3 Then
Selection.Rows.Group
End If
ActiveCell.Offset(-1).Select
Loop

Range("E" & LR).Select
Do Until ActiveCell.Row = 2
If ActiveCell.Value > 4 Then
Selection.Rows.Group
End If
ActiveCell.Offset(-1).Select
Loop

Range("E" & LR).Select
Do Until ActiveCell.Row = 2
If ActiveCell.Value > 5 Then
Selection.Rows.Group
End If
ActiveCell.Offset(-1).Select
Loop

Application.ScreenUpdating = True
End Sub