See if this helps.
Sub Macro2()
ActiveWorkbook.Save
ActiveWorkbook.SaveAs_ FileName:="C:\excel\Book2.xls"
Workbooks.Open FileName:="C:\Excel\Book1.xls"
Workbooks("BOOK2.XLS").Close SaveChanges:=True
End Sub
See if this helps.
Sub Macro2()
ActiveWorkbook.Save
ActiveWorkbook.SaveAs_ FileName:="C:\excel\Book2.xls"
Workbooks.Open FileName:="C:\Excel\Book1.xls"
Workbooks("BOOK2.XLS").Close SaveChanges:=True
End Sub
Thx....but looking to save 1 sheet from the workbook.
As_ FileName:="C:\excel\Book2.xls"
: Seen similar posts, but now answers. What I'm trying to do is place a command button with code that will save 1 sheet from my workbook to a new file, close that file, and return to my open workbook. Sounds similar to what Dave asked below. I think we're looking for the same solution perhaps. Dave, if I get an answer I'll send it your way. Thanks VBA'ers
Thx....but looking to save 1 sheet from the workbook.
Thanks. But I'm trying to save 1 sheet only from the workbook and then allow the user to import that sheet or use data from it later in the original workbook.
As_ FileName:="C:\excel\Book2.xls"
: Seen similar posts, but now answers. What I'm trying to do is place a command button with code that will save 1 sheet from my workbook to a new file, close that file, and return to my open workbook. Sounds similar to what Dave asked below. I think we're looking for the same solution perhaps. Dave, if I get an answer I'll send it your way. Thanks VBA'ers
Re: Thx....but looking to save 1 sheet from the workbook.
Sorry, try this one:
Sheets("NameofSheetToBeCopied").Select
Sheets("NameofSheetToBeCopied").Copy Before:=Workbooks_("NewFile").Sheets(1)
Windows("NameofSheetToBeCopied.xls").Activate
Thanks. But I'm trying to save 1 sheet only from the workbook and then allow the user to import that sheet or use data from it later in the original workbook. : : See if this helps. : Sub Macro2() : ActiveWorkbook.Save : ActiveWorkbook.SaveAs_ FileName:="C:\excel\Book2.xls" : Workbooks.Open FileName:="C:\Excel\Book1.xls" : Workbooks("BOOK2.XLS").Close SaveChanges:=True : End Sub
: