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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
  • 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,216,155
Messages
6,129,185
Members
449,492
Latest member
steveg127

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