Sep 28 2023 11:51 PM
Hello,
somehow I created accidently an Outline group which is empty in Excel Version 2302 Microsoft 365 Apps for Enterprise.
These groups seem to be empty but I am not sure how to remove them without removing the other groups.
How can I remove group 4 + 5 which do not seem to have any meaning ? See picture below.
Bet regards
Frank
__PRESENT
__PRESENT
Sep 29 2023 05:42 AM
Hi @FrankK2185,
There are two ways to remove empty outline groups in Excel Version 2302 Microsoft 365 Apps for Enterprise:
Sub RemoveEmptyOutlineGroups()
'Declare variables
Dim wks As Worksheet
Dim outlineGroup As OutlineGroup
'Set the worksheet variable
Set wks = ActiveSheet
'Iterate through all outline groups on the worksheet
For Each outlineGroup In wks.OutlineGroups
'If the outline group is empty, delete it
If outlineGroup.Count = 0 Then outlineGroup.Delete
Next outlineGroup
End Sub
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)
Sep 29 2023 07:16 AM
Hello thanks for your answer.
Actually I do not have button Show Outline
Running the VBA macro throws an error:
Best regards
Frank
__PRESENT
Sep 29 2023 04:02 PM