Trying to Copy sheets to a new workbook then hide sheets on original workbook

I'm trying to copy a group of sheets to a new workbook and then hide the initial sheets on the original workbook?'

      Sheets(Array("Read Me", "Sheet1", "Sheet2")). _
        Select

    Sheets(Array("Read Me", "Sheet1", "Sheet2")). _
        Copy
'Hide Readme

Open in new window


Thanks
LVL 1
mattfmillerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rory ArchibaldCommented:
To copy then hide all the originals, you could use:

    With Worksheets(Array("Read Me", "Sheet1", "Sheet2"))
        .Copy
        .Visible = xlSheetHidden
    End With

Open in new window

0
Rob HensonFinance AnalystCommented:
After copying to a new workbook, the new sheets will be active.

Therefore you will have to re-activate the source workbook to hide the original sheets.
0
Rory ArchibaldCommented:
@Rob
Not if you hold a reference to them, either with a With block, or a variable.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Rob HensonFinance AnalystCommented:
@Rory - didn't know that, everyday's a school day.
0
Rob HensonFinance AnalystCommented:
Otherwise, I would have suggested:

Source = ActiveWorkbook.Name
Sheets(Array("Read Me", "Sheet1", "Sheet2")).Select
Sheets(Array("Read Me", "Sheet1", "Sheet2")).Copy
Windows(Source).Activate
Sheets(Array("Read Me", "Sheet1", "Sheet2")).Visible = xlSheetHidden

Open in new window

0
Roy CoxGroup Finance ManagerCommented:
Assuming the code is in the original workbook, this workbook can be referred to as ThisWorkBook. When the sheets are copied then the new workbook created will be the ActiveWorkBook

Dim NewWb As String

ThisWorkbook.Sheets(Array("Read Me", "Sheet1", "Sheet2")).Copy
ThisWorkbook.Sheets(Array("Read Me", "Sheet1", "Sheet2")).Visible = xlSheetHidden

''/// save the new workbook
NewWb = Application.GetSaveAsFilename

If NewWb <> False Then
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & Application.PathSeparator & NewWb, FileFormat:=xlWorkbookNormal
End If

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mattfmillerAuthor Commented:
Thank you very much.  This is exactly what I needed.
0
Roy CoxGroup Finance ManagerCommented:
Pleased to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.