View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Looping Question

This code will go through the used range and do the grouping for the cells
with IndentLevels that are even. However, for IndentLevels that are odd,
there is no grouping. I tried a double-loop, like For i€¦Next i and For
j€¦Next j, but that didnt work.


Sub Grp()
Dim lngRow As Long
Sheets("Sheet1").Select
For i = 12 To 0 Step -2
For lngRow = Cells(Rows.Count, "B").End(xlUp).Row To 2 Step -1
If Range("B" & lngRow) < "" And Range("B" & lngRow).IndentLevel =
(i) Then
Range("B" & lngRow).Rows.Group
End If
Next lngRow
Next i
End Sub

What do I need to do to make this group both even Indents and odd Indents?

Thanks,
Ryan---

P.S., sorry for that other post...not sure how THAT happened...
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.