K. Pretty new to all of this - - all of what I have so far is from researching online but I'm still coming across a problem.....
Goal is to have a macro run based on a selection that is made from a drop down list.
My list will consist of 6 different macros that I would like to run OR what "view" I would like to see with the selection that is made.
For instance, my drop down list will be: Week 1, Week 2, Week 3, Week 4, Week 5, Month ..... and when I select "Week 1" it will run a macro that first will un-hide all rows in the worksheet (bc if the current view has rows hidden they might need to be un-hidden for this particular view) then hide certain rows (that are predetermined) that are specific to the "Week 1" view. So then when I select that I would like to view "Week 3" it will show me only Week 3.
Note: I originally had assigned the macros to buttons and they worked perfectly, however, now that I added a list it's not working and Im not 100% sure of what I'm doing (regarding a combo box)? Again, I just pulled things from research I did online, Im not extremely knowledgeable in this area.
Please help!
I also have added a seperate macro for a check box to hide/unhide columns and it works perfectly - - it seems, though, when I added that, this is when my other macros stopped working? IDK?? All help would be greatly appreciated!!
Thanks in advance!
I've posted my macros below for easy reference
Sub Week1view()
'
' Week1view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Rows("11:19").Select
ActiveWindow.SmallScroll Down:=12
Range("11:19,29:37").Select
Range("A29").Activate
ActiveWindow.SmallScroll Down:=21
Range("11:19,29:37,47:55").Select
Range("A47").Activate
ActiveWindow.SmallScroll Down:=18
Range("11:19,29:37,47:55,65:73").Select
Range("A65").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-45
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub Week2view()
'
' Week2view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Range("9:10,13:19").Select
Range("A13").Activate
ActiveWindow.SmallScroll Down:=12
Range("9:10,13:19,27:28,31:37").Select
Range("A31").Activate
ActiveWindow.SmallScroll Down:=21
Range("9:10,13:19,27:28,31:37,45:46,49:55").Select
Range("A49").Activate
ActiveWindow.SmallScroll Down:=15
Range("9:10,13:19,27:28,31:37,45:46,49:55,63:64,67:73").Select
Range("A67").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-45
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub Week3view()
'
' Week3view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Range("9:12,15:19").Select
Range("A15").Activate
ActiveWindow.SmallScroll Down:=12
Range("9:12,15:19,27:30,33:37").Select
Range("A33").Activate
ActiveWindow.SmallScroll Down:=18
Range("9:12,15:19,27:30,33:37,45:48,51:55").Select
Range("A51").Activate
ActiveWindow.SmallScroll Down:=21
Range("9:12,15:19,27:30,33:37,45:48,51:55,63:66,69:73").Select
Range("A69").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-48
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub Week4view()
'
' Week4view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Range("9:14,17:19").Select
Range("A17").Activate
ActiveWindow.SmallScroll Down:=15
Range("9:14,17:19,27:32,35:37").Select
Range("A35").Activate
ActiveWindow.SmallScroll Down:=18
Range("9:14,17:19,27:32,35:37,45:50,53:55").Select
Range("A53").Activate
ActiveWindow.SmallScroll Down:=9
Range("9:14,17:19,27:32,35:37,45:50,53:55,63:68,71:73").Select
Range("A71").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-51
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub Week5view()
'
' Week5view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Range("9:16,19:19").Select
Range("A19").Activate
ActiveWindow.SmallScroll Down:=12
Range("9:16,19:19,27:34,37:37").Select
Range("A37").Activate
ActiveWindow.SmallScroll Down:=18
Range("9:16,19:19,27:34,37:37,45:52,55:55").Select
Range("A55").Activate
ActiveWindow.SmallScroll Down:=21
Range("9:16,19:19,27:34,37:37,45:52,55:55,63:70,73:73").Select
Range("A73").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-42
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub EntireMonthView()
'
' EntireMonthView Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Private Sub ComboBox1_Click()
Select Case ComboBox1.Value
Case "Week 1"
Week1view
Case "Week 2"
Week2view
Case "Week 3"
Week3view
Case "Week 4"
Week4view
Case "Week 5"
Week5view
Case "Month"
EntireMonthView
Case Else
Exit Sub
End Select
End Sub
------------------
Sub HideColumns()
Dim MyRange As Range
Set MyRange = Range("B:F,J:O,H:H,R:V")
MyRange.EntireColumn.Hidden = Not MyRange.EntireColumn.Hidden
End Sub
Goal is to have a macro run based on a selection that is made from a drop down list.
My list will consist of 6 different macros that I would like to run OR what "view" I would like to see with the selection that is made.
For instance, my drop down list will be: Week 1, Week 2, Week 3, Week 4, Week 5, Month ..... and when I select "Week 1" it will run a macro that first will un-hide all rows in the worksheet (bc if the current view has rows hidden they might need to be un-hidden for this particular view) then hide certain rows (that are predetermined) that are specific to the "Week 1" view. So then when I select that I would like to view "Week 3" it will show me only Week 3.
Note: I originally had assigned the macros to buttons and they worked perfectly, however, now that I added a list it's not working and Im not 100% sure of what I'm doing (regarding a combo box)? Again, I just pulled things from research I did online, Im not extremely knowledgeable in this area.
Please help!
I also have added a seperate macro for a check box to hide/unhide columns and it works perfectly - - it seems, though, when I added that, this is when my other macros stopped working? IDK?? All help would be greatly appreciated!!
Thanks in advance!
I've posted my macros below for easy reference
Sub Week1view()
'
' Week1view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Rows("11:19").Select
ActiveWindow.SmallScroll Down:=12
Range("11:19,29:37").Select
Range("A29").Activate
ActiveWindow.SmallScroll Down:=21
Range("11:19,29:37,47:55").Select
Range("A47").Activate
ActiveWindow.SmallScroll Down:=18
Range("11:19,29:37,47:55,65:73").Select
Range("A65").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-45
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub Week2view()
'
' Week2view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Range("9:10,13:19").Select
Range("A13").Activate
ActiveWindow.SmallScroll Down:=12
Range("9:10,13:19,27:28,31:37").Select
Range("A31").Activate
ActiveWindow.SmallScroll Down:=21
Range("9:10,13:19,27:28,31:37,45:46,49:55").Select
Range("A49").Activate
ActiveWindow.SmallScroll Down:=15
Range("9:10,13:19,27:28,31:37,45:46,49:55,63:64,67:73").Select
Range("A67").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-45
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub Week3view()
'
' Week3view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Range("9:12,15:19").Select
Range("A15").Activate
ActiveWindow.SmallScroll Down:=12
Range("9:12,15:19,27:30,33:37").Select
Range("A33").Activate
ActiveWindow.SmallScroll Down:=18
Range("9:12,15:19,27:30,33:37,45:48,51:55").Select
Range("A51").Activate
ActiveWindow.SmallScroll Down:=21
Range("9:12,15:19,27:30,33:37,45:48,51:55,63:66,69:73").Select
Range("A69").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-48
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub Week4view()
'
' Week4view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Range("9:14,17:19").Select
Range("A17").Activate
ActiveWindow.SmallScroll Down:=15
Range("9:14,17:19,27:32,35:37").Select
Range("A35").Activate
ActiveWindow.SmallScroll Down:=18
Range("9:14,17:19,27:32,35:37,45:50,53:55").Select
Range("A53").Activate
ActiveWindow.SmallScroll Down:=9
Range("9:14,17:19,27:32,35:37,45:50,53:55,63:68,71:73").Select
Range("A71").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-51
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub Week5view()
'
' Week5view Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
Range("9:16,19:19").Select
Range("A19").Activate
ActiveWindow.SmallScroll Down:=12
Range("9:16,19:19,27:34,37:37").Select
Range("A37").Activate
ActiveWindow.SmallScroll Down:=18
Range("9:16,19:19,27:34,37:37,45:52,55:55").Select
Range("A55").Activate
ActiveWindow.SmallScroll Down:=21
Range("9:16,19:19,27:34,37:37,45:52,55:55,63:70,73:73").Select
Range("A73").Activate
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-42
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Sub EntireMonthView()
'
' EntireMonthView Macro
'
'
Cells.Select
Selection.EntireRow.Hidden = False
ActiveWindow.SmallScroll Down:=0
Rows("41:77").Select
Selection.EntireRow.Hidden = True
ActiveWindow.SmallScroll Down:=-66
Range("A5").Select
End Sub
------------------
Private Sub ComboBox1_Click()
Select Case ComboBox1.Value
Case "Week 1"
Week1view
Case "Week 2"
Week2view
Case "Week 3"
Week3view
Case "Week 4"
Week4view
Case "Week 5"
Week5view
Case "Month"
EntireMonthView
Case Else
Exit Sub
End Select
End Sub
------------------
Sub HideColumns()
Dim MyRange As Range
Set MyRange = Range("B:F,J:O,H:H,R:V")
MyRange.EntireColumn.Hidden = Not MyRange.EntireColumn.Hidden
End Sub