Selecting Specific Sheets

pazzam

New Member
Joined
Sep 14, 2011
Messages
6
Hello,

I have just been sent a timetable for the year. Each day of the year has its own sheet in the Excel document. However, as I am part-time, the only sheets that apply to me are those which say that the top, PT WEEKEND.
ITS SO ANNOYING.

Does anyone know if it would be possible to perform a search on all the sheets, select all those which contain/ do not contain PT WEEKEND and copy/ delete those selected? Then I will be left with the correct sheets.

Cheers.

Paz :confused:
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the Board!

Here is a suggestion. You could create a macro that would any non "PT WEEKEND" sheet. We could help you od that if you can tell use where this "PT WEEKEND" resides.

Is it part of the worksheet tab name?
Or is it in a certain cell on every page?
If so, which cell, and is there ever anything else along with "PT WEEKEND" in this cell (i.e. a date)?
 
Upvote 0
Hey,

Thanks for the reply. Its always in A3 and always says "PT WEEKEND: Number"

The number depends on which week it is.

Cheers.
 
Upvote 0
If it isnt a sheet that contains "PT WEEKEND:" then the whole calendar table is shifted up one.. so its not blank.
 
Upvote 0
OK, here is some code that will hide those sheets that do not have that in cell A3:
Code:
Sub MyHideSheets()
 
    Dim ws As Worksheet
 
    For Each ws In ActiveWorkbook.Worksheets
        If Left(ws.Range("A3"), 10) = "PT WEEKEND" Then
            ws.Visible = True
        Else
            ws.Visible = False
        End If
    Next ws
 
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,152
Members
452,891
Latest member
JUSTOUTOFMYREACH

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