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
32
Office Version
  1. 365
Platform
  1. Windows
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!!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,808
Messages
6,121,686
Members
449,048
Latest member
81jamesacct

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