dimanche 29 août 2021

VBA If Statement if Row is not Outlined

The below is used to control code depending on outline level of row. It is working except for when there is no outline level.

Is it correct to use OutlineLevel = 0 when no outlining? I cannot find any information on this.

If ActiveCell.Rows.OutlineLevel = 0 Then MsgBox "No group Selected", vbCritical, "Admin": Exit Sub
    
If ActiveCell.Rows.OutlineLevel = 2 Then MsgBox "Please Collapse group first", vbCritical, "Admin": Exit Sub
        
If ActiveCell.Rows.OutlineLevel = 1 Then

Aucun commentaire:

Enregistrer un commentaire