Rename Worksheets and Copy Data

SAMUSER

Board Regular
Joined
Jul 27, 2012
Messages
82
Hi everyone,

I need to copy data from one workbook- all of it, containing multiple worksheets. This needs to be pasted onto a new workbook with the same worksheet names as the previous workbook.

I need help with copying the names of the worksheets and pasting them onto the new workbook. And frankly, I am hitting a dead end. Any help would be appreciated.

Thanks,
Saim
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
  • Select the first sheet
  • Shift+Click on the last sheet's tab to select all the sheets
  • Right-click on one of the selected sheet tabs
  • Select Move or Copy from the pop-up context menu
    • To book: (new book)
    • Check the Create a copy checkbox
    • OK
 
Upvote 0
Hi Alpha Frog,

Thanks for the help. I am looking to do this multiple times. Therefore, I need to use a macro for this process. I have gotten some code fromt he recorder, but I need to generalize it so that it asks the user the location of the file (from which data is being copied), activates the file, copies everything, and then pastes in the destination folder.

This is what I have to copy the sheets and paste them so far:


Code:
' Macro4 Macro
    Sheets("Income Brackets").Select
    ActiveWindow.ScrollWorkbookTabs Sheets:=20
    Sheets(Array("Income Brackets", "Program Data", "Impact Map", "Participant Names", _
        "Parameters", "Stakeholders", "Subjects", "Employees", "Year Data", "Participants", _
        "Subjects - Program Data", "MoH - Program Data", "Federal Govt - Program Data", _
        "Employees - Program Data")).Select
    Sheets("Employees - Program Data").Activate
    Sheets(Array("Income Brackets", "Program Data", "Impact Map", "Participant Names", _
        "Parameters", "Stakeholders", "Subjects", "Employees", "Year Data", "Participants", _
        "Subjects - Program Data", "MoH - Program Data", "Federal Govt - Program Data", _
        "Employees - Program Data")).Copy Before:=Workbooks("Book2").Sheets(18)
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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