Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel VBA确定工作表中的分组行_Excel_Vba - Fatal编程技术网

Excel VBA确定工作表中的分组行

Excel VBA确定工作表中的分组行,excel,vba,Excel,Vba,在excel vba中,我可以使用 NewSheet.rows("15:22").Group 但如何确定工作表中哪些行已分组?使用下面的代码扫描“新闻纸”中包含数据的所有行,并检查每行是否已分组 ' scan all rows in your sheet For i = 2 To lastRow ' check isf current row is grouped If NewSheet.Rows(i).OutlineLevel > 1 Then ' d

在excel vba中,我可以使用

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

但如何确定工作表中哪些行已分组?

使用下面的代码扫描“新闻纸”中包含数据的所有行,并检查每行是否已分组

' 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

也许可以检查行的
OutlineLevel