Looping Issue
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---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
"Augusto_Madrid" wrote:
Hi everyone out there!
I have some 200 pivot tables and I need to do two things on them:
1) change one of the filtering variables above the tables
2) I need the new filter variable to be determined by a scroll menu that's
somewhere else in the same file, but a different sheet; e.g., if I choose
option "2" in the scroll menu, I need the tables to be filtered by variable
"2"
Can this be done at all?
Any help will be welcome, I'm stuck with macros here...
Thanks!
Augusto
|