Hi there. I have a Workbook with two sheets. One has a bunch of cashflows [Worksheets("I_Deal")] while the other sheet [Worksheets("II_Summary")] is linked to the "I_Deal" worksheet and has summary information and graphs on those cashflows.
"I_Deal" sheet has rows that were grouped. There are three levels. The problem that I have is that when the data in "I_Deal" is grouped at Level 1 (ie, the information is summarized and many rows are not visible) and I activate worksheet "II_Summary", all the graphs look "empty". When I activate worksheet "II_Summary" with the data in "I_Deal" at level 3 (all data expanded and visible), the graphs display correctly.
To solve that problem I started a Macro [located in Sheet(II_Summary)]. The macro is intended to showlevel 3 whenever Sheet "II_Summary" is activated, and return to the previous showlevel whenever Sheet "II_Summary" is Deactivated. I managed to do the first task, but I'm having problems when I try to include the second task. Here you'll find the code. I appreciate any suggestions.
"I_Deal" sheet has rows that were grouped. There are three levels. The problem that I have is that when the data in "I_Deal" is grouped at Level 1 (ie, the information is summarized and many rows are not visible) and I activate worksheet "II_Summary", all the graphs look "empty". When I activate worksheet "II_Summary" with the data in "I_Deal" at level 3 (all data expanded and visible), the graphs display correctly.
To solve that problem I started a Macro [located in Sheet(II_Summary)]. The macro is intended to showlevel 3 whenever Sheet "II_Summary" is activated, and return to the previous showlevel whenever Sheet "II_Summary" is Deactivated. I managed to do the first task, but I'm having problems when I try to include the second task. Here you'll find the code. I appreciate any suggestions.
Code:
Option Explicit
Dim i As Integer
Private Sub Worksheet_Activate()
i = Worksheets("I_Deal").Columns(2).OutlineLevel
Worksheets("I_Deal").Outline.ShowLevels RowLevels:=3
Debug.Print Worksheets("I_Deal").Rows(36).OutlineLevel
End Sub
Private Sub Worksheet_Deactivate()
Worksheets("I_Deal").Outline.ShowLevels RowLevels:=i
End Sub