user2088476
user2088476

Reputation: 613

Excel VBA determine grouped rows in worksheet

In excel vba I can group rows in a worksheet using

NewSheet.rows("15:22").Group

But how can I determine which rows are already grouped in a worksheet?

Upvotes: 2

Views: 8012

Answers (1)

Shai Rado
Shai Rado

Reputation: 33692

Use the code below to scan all rows with data in "NewSheet", and check per row if it's already grouped.

' scan all rows in your sheet
For i = 2 To lastRow

    ' check isf current row is grouped
    If NewSheet.Rows(i).OutlineLevel > 1 Then
        ' do something

    End If
Next i

Upvotes: 3

Related Questions