How to save 2 worksheets as one workbook?

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I've had some progression with this but its not working:

'Copy the sheet to a new workbook
strWorksheet = Array("Receivables", "OUTPUT")
Worksheets(strWorksheet).Copy
Set Destwb = ActiveWorkbook

Application.DisplayAlerts = False

With Destwb
.SaveAs TempFilePath & TempFileName & FileExtStr, _
FileFormat:=FileFormatNum

Workbooks(TempFileName & FileExtStr).Close True

Any ideas where it could be going wrong?
 
Upvote 0
Maybe something like:
Code:
Sub Save2sheets1book()
    Dim x
    Dim originalBook As String
    originalBook = ThisWorkbook.Name
    
    Workbooks.Add
    
    Workbooks(originalBook).Sheets("SheetToCopy1").Copy Before:=ActiveWorkbook.Sheets(1)
    Workbooks(originalBook).Sheets("SheetToCopy2").Copy Before:=ActiveWorkbook.Sheets(2)
    
    Application.DisplayAlerts = False
    
    For x = ActiveWorkbook.Sheets.Count To 3 Step -1
        ActiveWorkbook.Sheets(x).Delete
    Next x
    
    Application.DisplayAlerts = True
    
    ActiveWorkbook.SaveAs Filename:="New2sheetBook"
    
End Sub
 
Upvote 0
Maybe this?

Code:
Sheets(Array("Receivables", "OUTPUT")).Copy
ActiveWorkbook.Close savechanges:=True
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,710
Members
452,939
Latest member
WCrawford

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