Ryanchris
12-24-2019, 01:44 PM
Hi all,
Looking for code that will allow me to expand a certain column range. I have a button on one worksheet (sheet1, Dashboard), that when pressed, needs to take me to an now expanded column on Sheet15 called Job Summary. The columns to expand on Sheet 15 are AR:BI. I thought the code below would work but it only works if I run it when I am actually on Sheet15. If I run it from the button on Sheet1, it stays on sheet1 and does not open the group on Sheet15.
Sub Expand_JobSummary()
Dim wks As Worksheet
Worksheets("sheet15").Outline.ShowLevels rowlevels:=1, columnlevels:=1
Columns("AR:BI").Select
Selection.EntireColumn.Hidden = False
End Sub
I am a beginner to VBA - what did I miss?
Thank you so much!
Looking for code that will allow me to expand a certain column range. I have a button on one worksheet (sheet1, Dashboard), that when pressed, needs to take me to an now expanded column on Sheet15 called Job Summary. The columns to expand on Sheet 15 are AR:BI. I thought the code below would work but it only works if I run it when I am actually on Sheet15. If I run it from the button on Sheet1, it stays on sheet1 and does not open the group on Sheet15.
Sub Expand_JobSummary()
Dim wks As Worksheet
Worksheets("sheet15").Outline.ShowLevels rowlevels:=1, columnlevels:=1
Columns("AR:BI").Select
Selection.EntireColumn.Hidden = False
End Sub
I am a beginner to VBA - what did I miss?
Thank you so much!