Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to save as
I want to create a macro to get the contents of a cell of a specific sheet,
open save as dialog and using the contents of that cell as the new filename, to save only the current sheet. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to save as
Try something along these lines. Press Alt+F11 and select INSERT from the
menu and select MODULE: Sub CopyWS() Dim strName As String Dim ws As Worksheet 'Change range to the cell that contains the new filename strName = Range("A1").Value Set ws = ThisWorkbook.Sheets(1) Application.Workbooks.Add ws.Copy befo=ActiveWorkbook.Sheets(1) ActiveWorkbook.SaveAs strName Set ws = Nothing End Sub -- Kevin Backmann "frageo64" wrote: I want to create a macro to get the contents of a cell of a specific sheet, open save as dialog and using the contents of that cell as the new filename, to save only the current sheet. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to save as
Kevin thank you very much for your help. Can I take it a lilltle bit further
and instead of copying a sheet can I copy a range of cells? "Kevin B" wrote: Try something along these lines. Press Alt+F11 and select INSERT from the menu and select MODULE: Sub CopyWS() Dim strName As String Dim ws As Worksheet 'Change range to the cell that contains the new filename strName = Range("A1").Value Set ws = ThisWorkbook.Sheets(1) Application.Workbooks.Add ws.Copy befo=ActiveWorkbook.Sheets(1) ActiveWorkbook.SaveAs strName Set ws = Nothing End Sub -- Kevin Backmann "frageo64" wrote: I want to create a macro to get the contents of a cell of a specific sheet, open save as dialog and using the contents of that cell as the new filename, to save only the current sheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MACRO SAVE HELP | Excel Worksheet Functions | |||
save as macro | Excel Discussion (Misc queries) | |||
Save As Macro | Excel Discussion (Misc queries) | |||
Macro to Save without the Save Message | Excel Discussion (Misc queries) | |||
Macro to save | Excel Worksheet Functions |