Copying and Saving Individual Workbooks into a New Workbook

Hello,

I have a macro that identifies sheets that need to be collected into an individual workbook.  I was wondering if there was a way to use indexing or Worksheet Names to select those sheets to do activities on them.  

Is there a way to take the beginning sheet and end sheet to select all the sheets inbetween or using a collection of names in a running string in between?

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.

Wayne Taylor (webtubbs)Commented:
You can use something like this routine to select a group of worksheets given a Start and End index number....

Sub SelectSheets(iStart As Integer, iEnd As Integer)

    Dim i As integer
    Sheets(iStart).Select Replace:=True
    For i = iStart + 1 To iEnd
        Sheets(i).Select Replace:=False
    Next

End Sub

Open in new window


Alternatively, you can use this to select predefined worksheets...

Sheets(Array("Sheet1", "Sheet2")).Select

Open in new window


Wayne
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 the first one is exactly what I need.
0
mattfmillerAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for mattfmiller's comment #a40799399

for the following reason:

Absolutely perfect and straightforward.
0
Wayne Taylor (webtubbs)Commented:
I'm glad it worked for you. Please use the Accept as Answer link on my post, not your own.
0
mattfmillerAuthor Commented:
Sorry I clicked on the wrong one.
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
Microsoft Office

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.