Copy All Selected Sheets into new workbook and leave dialogue box open to select location to save file

blaker

New Member
Joined
Jul 1, 2013
Messages
11
I have the below code to save one selected sheet into a new workbook (Macro Enabled) using the active sheet range b12 at the file name..

how would I change the code to Copy all selected sheets into new workbook (Macro Enabled) still using the active sheet range b12 for the file name and leave the Dialogue box open to choose the location to save the new file.

here is the code I have so far...

Private Sub CommandButton23_Click()
Dim filename As Variant
Dim Path As String

ActiveSheet.Copy

ActiveWorkbook.SaveAs filename:=Range("b12") & Format(Date, "ddmmyyyy") & ".xlsm", FileFormat:=52


ActiveWorkbook.Close


End Sub

Thanks for any help with this!!
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Watch MrExcel Video

Forum statistics

Threads
1,127,846
Messages
5,627,235
Members
416,232
Latest member
Ash1432

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
Top