I have grouped few rows in my excel sheet. I have added couple of buttons to hide and unhide the rows. But I want to combine the code and have only one button which works more like a toggle button. I am not able to achieve this. These are my individual functions.
Sub Button1_Click()
ActiveSheet.Outline.ShowLevels Rowlevels:=1
End Sub
Sub Button2_Click()
ActiveSheet.Outline.ShowLevels Rowlevels:=2
End Sub
Any help with this is appreciated. Please note: I do not have any experience with VBA and I need this to be done for my maanger's requirement on one of his work.
Thanks
Rowlevels:1
and hides the other and vise versa? – L42