Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheet Ranges Possible?
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vba help...ranges in new sheet etc | Excel Programming | |||
How to find ranges in a sheet | Excel Programming | |||
Copying ranges from one sheet to another | Excel Programming | |||
selectively copying ranges from one sheet to second sheet | Excel Programming | |||
Combine ranges from 2 sheet into 3rd | Excel Programming |