Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

copying and dumping specific

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Copying and dumping specific spreadsheets into a new workbook

Copying and dumping specific spreadsheets into a new workbook

ResolvedVersion 2010

Freddie has attended:
Excel VBA Introduction course

Copying and dumping specific spreadsheets into a new workbook

Hi Guys!

Firstly, my level of VBA is basic to say the least!

I'm trying to copy over three spreadsheets named "LBARATEF", "LBARARIF", "LBAMKTLF" from one workbook named "Current" and paste them into a New Workbook.

I'd ideally want the new spreadsheets in the new workbook with each spreadsheet to be named each after the file that has been copied over (i.e. "LBARATEF", "LBARARIF", "LBAMKTLF")

Are you able to provide a code that would assist with the above as I am pulling my hair out over this!

Any help is hugely appreciated! :)

Thanks!

Freddie


RE: Copying and dumping specific spreadsheets into a new workboo

Hi Freddie,

Thank you for your question. The following macro seems to do the trick for me. You can just copy it and paste it into the Macro Editor code window of your workbook. (Press Alt+F11 to open it)

Sub CopySheets()
Sheets(Array("LBARATEF", "LBARARIF", "LBAMKTLF")).Select
Sheets("LBAMKTLF").Activate
Sheets(Array("LBARATEF", "LBARARIF", "LBAMKTLF")).Copy
End Sub

I hope this helps.

Kind regards
Marius Barnard
Excel Trainer

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Get back to active cell

If you have scrolled away from the active celland want to get back t it quicly you can Ctrl and Backspace to get back

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.18 secs.