ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Saving a worksheet (https://www.excelbanter.com/excel-discussion-misc-queries/243875-saving-worksheet.html)

Ed Davis[_2_]

Saving a worksheet
 
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.


--
Thank You in Advance
Ed Davis



Don Guillett

Saving a worksheet
 
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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ed Davis" wrote in message
...
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.


--
Thank You in Advance
Ed Davis



Ed Davis[_2_]

Saving a worksheet
 
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" wrote in message
...
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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ed Davis" wrote in message
...
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.


--
Thank You in Advance
Ed Davis






All times are GMT +1. The time now is 08:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com