Saving a worksheet

E

Ed Davis

Currently when the user uses a macro I save a copy of the workbook with the
sheet name imbedded in the workbook name. This is to indicate to me what
sheet the user was editing when the macro was run. example below:
workbook name saved as Sales 09-2009 (sheet1).xls.

Is there a way just to save the sheet they were working on. It would have to
be copied as values for this save only so I think I would have to first copy
the sheet to a new sheet as values. And then After the saving has completed
I would want the new sheet deleted from the workbook.

I hope I made myself clear enough on this if not I will give better detail.
 
D

Don Guillett

The macro recorder is your friend. I just recorded this
Sub Macro15()
'
' Macro15 Macro
' Macro recorded 9/27/2009 by Donald B. Guillett
'

'
Sheets("Sheet19").Select
Sheets("Sheet19").Move
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:="C:\personal\mynewbookname.xls",
FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
End Sub
 
E

Ed Davis

Thank you Don
After making recording it myself and making a few changes it is just what I
was looking to do.
I did not know that feature was in Excel.

Thanks for your help.


Ed Davis
Don Guillett said:
The macro recorder is your friend. I just recorded this
Sub Macro15()
'
' Macro15 Macro
' Macro recorded 9/27/2009 by Donald B. Guillett
'

'
Sheets("Sheet19").Select
Sheets("Sheet19").Move
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:="C:\personal\mynewbookname.xls",
FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top