Example copies worksheets Sheet1, Sheet2 and Sheet4 to a new blank bk

This example copies worksheets Sheet1, Sheet2 and Sheet4 to a new blank workbook, then saves and closes the new workbook.

VB

Copy
Worksheets(Array("Sheet1", "Sheet2", "Sheet4")).Copy
With ActiveWorkbook
     .SaveAs Filename:=Environ("TEMP") & "\New3.xlsx", FileFormat:=xlOpenXMLWorkbook
     .Close SaveChanges:=False
End With

Comments

Popular posts from this blog

number format

send Mail by outlook from excel sheet

Find and copy the data