Group worksheets together under 1 tab?

jmcgurl

Board Regular
Joined
Nov 14, 2014
Messages
74
Hi,

I am not sure if these is possible but I currently have 1 workbook with 7 worksheets (1 for each day of the week). In the past, I would start a new workbook each week for that weeks data. However, I have now been tasked with creating 1 large workbook for each month.

With that said, instead of having 31-37 tabs on the bottom is there a way to group the worksheets together so that when Week 1 is selected it opens into just its 7 worksheets?

Thanks for your help!
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
You could show the relevant 7 worksheets, and hide the rest. Something like this perhaps, assuming you have range names for "WeekNo", and "StartDate", and that your sheet names can be converted to dates, e.g. "2-Mar-15", "3-Mar-15" etc.

If each week starts on Monday, say, and StartDate is Monday 30 March 2015, this code will hide any date sheets other than "30-Mar-15", "31-Mar-15", ... "5-Apr-15".

Code:
'In the sheet module containing range name "WeekNo" 
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim ws As Worksheet
    Dim dteStartDate As Date
    Dim lVisible As Long
    
    If Intersect(Target, Range("WeekNo")) Is Nothing Then Exit Sub
        
    dteStartDate = Range("StartDate").Value
    
    For Each ws In Worksheets
        lVisible = xlSheetVisible
        On Error Resume Next
        lVisible = CVDate(ws.Name) >= dteStartDate And CVDate(ws.Name) < dteStartDate + 7
        On Error GoTo 0
        ws.Visible = lVisible
    Next ws

End Sub
 
Upvote 0
Thank you for your response and help. After a lot of thought I ended up creating a totally different workbook.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top