Save sheet as new tab on old file

begoldar

Board Regular
Joined
Dec 20, 2005
Messages
98
Hi Everyone,

Is it possible to write a macro that will save the current worksheet I am working on as a NEW tab on an existing file? ie, Clicking on a run macro button will bring up the "save as" screen, allowing the user to pick the file into which he/she wants to save the current workbook. Then, it will automatically create a new worksheet in that file, copy the data in the open workbook to that worksheet, save, and then close. (This will also take off all macros since only the data in the spreadsheet will be copied.) Thanks in advance!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
keep both the files open.
in the source file right click the relevant sheet tab and click copy or move sheet.
in the resulting window REMEMBER to check COPY SHEET

In the top window "to book" choose the relevant file (destination file )and click ok

if you want a macro use the code statement like this
Code:
Sheets("Sheet1").Copy Before:=Workbooks("Book5").Sheets(1
this macro should be placed in the source file vb editor(i.e.Book 4). Book 5 is the destination file.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,864
Members
449,052
Latest member
Fuddy_Duddy

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