Silverjman
Board Regular
- Joined
- Mar 19, 2014
- Messages
- 110
Hello All,
FYI: I have a couple sheets that have 12 to 15 groups of grouped columns, these have replaced 24 to 30 separate sheets.
Other sheets, say the Cashflow sheet, link to the two sheets with loads of groupings. I/the user often double clicks or
"ctrl-[" to jump from the Cashflow sheet to the aforementioned only to have those sheet grouped and the cell selected hidden.
Is there a single code snippet that if applied to the entire sheet would automatically ungroup the group of the cell that is being jumped to?
IF cell is selected expand grouping (in this case a Named Range)? Coding with Named Ranges is key for me here.
The below is just OTHER CODE that I have cobbled together and assigned to buttons on the respective sheets to pop open the groupings and give the user a similar experience to individual sheet tabs.
FYI: I have a couple sheets that have 12 to 15 groups of grouped columns, these have replaced 24 to 30 separate sheets.
Other sheets, say the Cashflow sheet, link to the two sheets with loads of groupings. I/the user often double clicks or
"ctrl-[" to jump from the Cashflow sheet to the aforementioned only to have those sheet grouped and the cell selected hidden.
Is there a single code snippet that if applied to the entire sheet would automatically ungroup the group of the cell that is being jumped to?
IF cell is selected expand grouping (in this case a Named Range)? Coding with Named Ranges is key for me here.
The below is just OTHER CODE that I have cobbled together and assigned to buttons on the respective sheets to pop open the groupings and give the user a similar experience to individual sheet tabs.
Code:
Sub UnCollapseAssetsDebt()
Set Debt = Range("Assets.Debt") 'Assets.Debt = Sheet's Name . Named Range
If Debt.EntireColumn.Hidden = True Then
Debt.EntireColumn.Hidden = False
End If
Debt(10, 1).Select
End Sub
Sub CollapseAssetsDebt()
Set Debt = Range("Assets.Debt")
If Debt.EntireColumn.Hidden = False Then
Debt.EntireColumn.Hidden = True
End If
Range("Assets.Assets")(10, 1).Select 'This just send the user back to the far left of the sheet
End Sub