Macro to Save just one sheet to new workbook.

  • Thread starter Thread starter Guy
  • Start date Start date
G

Guy

I need a macro that when selected will copy the currently displayed sheet of
a workbook to a new workbook *(with only the values, no macros or formulas),
and then, if possible, to also automatically bring up the 'Save As' window
with the current date as the name, formatted as (mm-dd-yy).

Thanks ya'll,
Guy
 
ActiveSheet.Copy
Set newbk = ActiveWorkbook
newbk.ActiveSheet.Cells.Copy
newbk.ActiveSheet.Cells.PasteSpecial Paste:=xlPasteValues

InitialName = Format(Date, "mm-dd-yy") & ".xls"
FName = Application.GetSaveAsFilename(InitialFileName:=InitialName, _
fileFilter:="Excel Files (*.xls), *.xls")
newbk.SaveAs Filename:=FName
 
That is perfect!
Thanks a bunch,
Guy

Joel said:
ActiveSheet.Copy
Set newbk = ActiveWorkbook
newbk.ActiveSheet.Cells.Copy
newbk.ActiveSheet.Cells.PasteSpecial Paste:=xlPasteValues

InitialName = Format(Date, "mm-dd-yy") & ".xls"
FName = Application.GetSaveAsFilename(InitialFileName:=InitialName, _
fileFilter:="Excel Files (*.xls), *.xls")
newbk.SaveAs Filename:=FName
 
Back
Top