LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vba help...ranges in new sheet etc zoola[_5_] Excel Programming 3 July 6th 05 06:51 PM
How to find ranges in a sheet Tornado Excel Programming 1 February 23rd 05 05:31 PM
Copying ranges from one sheet to another Sinobato[_9_] Excel Programming 0 July 29th 04 03:14 PM
selectively copying ranges from one sheet to second sheet JPTIII Excel Programming 1 December 5th 03 08:02 PM
Combine ranges from 2 sheet into 3rd David Turner Excel Programming 1 July 24th 03 11:57 PM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"