Copy specific sheets to a new workbook

Martin sherk

Board Regular
Joined
Sep 11, 2022
Messages
94
Office Version
  1. 365
  2. 2016
so i have a workbook with sheets that have data based on customer codes , for Ex: company code USA1 has 3 sheets: (USA1, USA1 distributors and USA1 PVT) Like elaborated in the pic below.

1666616110158.png


what i need is:
A VBA code to copy all data of these 3 sheets that starts with USA1 and paste it in a new workbook and name it USA1 Payments then save and close that workbook.

please note that i have 6 other company codes that goes like this USA2, USA3, USA4 and so on and each company code has 3 sheets as well.

I Appreciate your time reading this and thanks in advance.
 

Attachments

  • 1666615961623.png
    1666615961623.png
    1.8 KB · Views: 4
@HaHoBe Brilliant, thanks for showing me new ways to do this and for the time taken answering all my questions.
I wish you a wonderful day sir.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi Martin,

glad that I could help on this one and thanks for the feedback.

Holger
 
Upvote 0

Forum statistics

Threads
1,214,835
Messages
6,121,880
Members
449,057
Latest member
Moo4247

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