Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
creat a macro to save a copy with different file name
I need to creat a macro that save a copy of the file, and take the file
name from a cell at the worksheet. this cell is changing everytime i need to save the file, therefor i will not have the same file name. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
creat a macro to save a copy with different file name
One way:
Run Macro "Testme" and it will perform a File, Save_As (to the current directory) creating a File Name = to Cell J2. Sub testme() Application.Dialogs(xlDialogSaveAs).Show _ Worksheets("sheet1").Range("j2").Value & ".xls" End Sub HTH Jim "yrndtn" wrote in message ups.com: I need to creat a macro that save a copy of the file, and take the file name from a cell at the worksheet. this cell is changing everytime i need to save the file, therefor i will not have the same file name. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
creat a macro to save a copy with different file name
I named cell A1 on Sheet1, NewFileName, using the INSERT/NAME/DEFINE command
off the menu. This is the file save code: Sub SaveMe() Dim strName As String strName = Range("NewFileName").Text If Len(strName) = 0 Then MsgBox "There isn't a file name in cell A1." Else ActiveWorkbook.SaveAs strName End If End Sub -- Kevin Backmann "yrndtn" wrote: I need to creat a macro that save a copy of the file, and take the file name from a cell at the worksheet. this cell is changing everytime i need to save the file, therefor i will not have the same file name. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
Macro to save a file with ref to a tick box | Excel Discussion (Misc queries) | |||
Macro to auto save file using the format YYMM | Excel Discussion (Misc queries) | |||
save original data after macro is run again | New Users to Excel | |||
creat a macro to look for a file | Excel Discussion (Misc queries) |