N
None
Is it possible to assign sheets to a range instead of cells? I am not
sure to code it, can someone please help? Here is a simple example of
what I would like to do.
Given : Lets say I have 9 worksheets, but only want 3 sheets visible
at a time.
workSheets 1-3 = Range1 (First)
workSheets 4-6 = Range2 (Middle)
workSheets 7-9 = Range3 (Last)
Public Sub SheetMode(ByVal Mode As String)
‘ Turn off screen and events
Application.ScreenUpdating = False
Application.EnableEvents = False
‘ Show all to prevent no sheets visible error
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
'Hide unwanted sheets
Select Case Mode
Case "First"
'Code to Hide Middle & Last Sheet Ranges
Case "Middle"
'Code to Hide First & Last Sheet Ranges
Case "Last"
'Code to Hide First & Middle Sheet Ranges
End Select
‘ Turn on screen and events
Application.ScreenUpdating = True
Application.EnableEvents = True
End sub
sure to code it, can someone please help? Here is a simple example of
what I would like to do.
Given : Lets say I have 9 worksheets, but only want 3 sheets visible
at a time.
workSheets 1-3 = Range1 (First)
workSheets 4-6 = Range2 (Middle)
workSheets 7-9 = Range3 (Last)
Public Sub SheetMode(ByVal Mode As String)
‘ Turn off screen and events
Application.ScreenUpdating = False
Application.EnableEvents = False
‘ Show all to prevent no sheets visible error
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
'Hide unwanted sheets
Select Case Mode
Case "First"
'Code to Hide Middle & Last Sheet Ranges
Case "Middle"
'Code to Hide First & Last Sheet Ranges
Case "Last"
'Code to Hide First & Middle Sheet Ranges
End Select
‘ Turn on screen and events
Application.ScreenUpdating = True
Application.EnableEvents = True
End sub