Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I received this macro from one of the members of the community yesterday. It
saves the file with a filename from cell A1. It also saves it on a specific directory. Sub Save_As() Dim s As String s = "C:\Documents and Settings\user\My Documents\" & Range("A1").Value & ".xls" ActiveWorkbook.SaveAs Filename:=s End Sub I would like to have an updated macro whereby the destination directory would be the user's choice, maybe show the "Save As" window and let them choose and navigate from that window to the folder of their choice. The filename should still come from cell A1 of the file. Is this possible? Please help. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a whirl...
Sub Save_As() Dim objShell As Object Dim objFolder As Object Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(&H5&) Application.Dialogs(xlDialogSaveAs).Show _ objFolder.Self.Path & "\" & Range("A1").Value & ".xls" End Sub -- HTH... Jim Thomlinson "el zorro" wrote: I received this macro from one of the members of the community yesterday. It saves the file with a filename from cell A1. It also saves it on a specific directory. Sub Save_As() Dim s As String s = "C:\Documents and Settings\user\My Documents\" & Range("A1").Value & ".xls" ActiveWorkbook.SaveAs Filename:=s End Sub I would like to have an updated macro whereby the destination directory would be the user's choice, maybe show the "Save As" window and let them choose and navigate from that window to the folder of their choice. The filename should still come from cell A1 of the file. Is this possible? Please help. Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
Worked great. Thank you very much. "Jim Thomlinson" wrote: Give this a whirl... Sub Save_As() Dim objShell As Object Dim objFolder As Object Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(&H5&) Application.Dialogs(xlDialogSaveAs).Show _ objFolder.Self.Path & "\" & Range("A1").Value & ".xls" End Sub -- HTH... Jim Thomlinson "el zorro" wrote: I received this macro from one of the members of the community yesterday. It saves the file with a filename from cell A1. It also saves it on a specific directory. Sub Save_As() Dim s As String s = "C:\Documents and Settings\user\My Documents\" & Range("A1").Value & ".xls" ActiveWorkbook.SaveAs Filename:=s End Sub I would like to have an updated macro whereby the destination directory would be the user's choice, maybe show the "Save As" window and let them choose and navigate from that window to the folder of their choice. The filename should still come from cell A1 of the file. Is this possible? Please help. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I save part of a worksheet in a separate file? | Excel Worksheet Functions | |||
Save file using part of folder name | Excel Programming | |||
Save emails using only part of subject line | Excel Programming | |||
reading a range name as part of Save-as file | Excel Programming | |||
reading a range name as part of Save-as file | Excel Programming |