The trick to this seems to be that you have to check the outline property on a row by row basis, not a cell by cell basis.
Code:
Type GroupInfo
IsGrouped As Boolean
IsHidden As Boolean
End Type
Sub foo()
Dim rngToCheck As Range
Dim rngRow As Range
Dim GroupInformation As GroupInfo
Set rngToCheck = Range("A1:A21")
For Each rngRow In rngToCheck.Rows
GroupInformation = GetGroupInfo(rngRow)
Debug.Print "Row:"; rngRow.Row; _
"Grouped= "; GroupInformation.IsGrouped; _
" Hidden= "; GroupInformation.IsHidden
Next rngRow
End Sub
'you must pass in a 'Row' flagged type range, not a Cell type range
Function GetGroupInfo(ByVal rngRowToCheck As Range) As GroupInfo
GetGroupInfo.IsGrouped = (rngRowToCheck.OutlineLevel > 1)
GetGroupInfo.IsHidden = rngRowToCheck.Hidden
End Function
Hope that helps...