Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Save file as Cell Value
Hi Everyone,
I have the below routine set to copy a page to my desktop. Is there a way to have it change the save name to a particular cell's value? If Range(€śL6€ť) equals a certain word, I would like it to save as that particular name. Thanks in advance for your thoughts - Roger Sub Finalstop() ActiveSheet.Copy ChDir "C:\Documents and Settings\Roger\Desktop" ActiveWorkbook.SaveAs Filename:= _ "C:\Documents and Settings\Roger\Desktop\New File.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False ActiveWorkbook.Close End |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Save file as Cell Value
hi
this might work... Dim mypath As String Dim nrng As Range Dim fname As String Set nrng = Range("A1") mypath = "C:\your\file\path\" fname = nrng.Value & ".xls" ActiveWorkbook.SaveAs Filename:= _ mypath & fname, FileFormat:= _ xlNormal, Password:="", _ WriteResPassword:="", _ ReadOnlyRecommended:=False, _ CreateBackup:=False regards FSt1 "Roger" wrote: Hi Everyone, I have the below routine set to copy a page to my desktop. Is there a way to have it change the save name to a particular cell's value? If Range(€śL6€ť) equals a certain word, I would like it to save as that particular name. Thanks in advance for your thoughts - Roger Sub Finalstop() ActiveSheet.Copy ChDir "C:\Documents and Settings\Roger\Desktop" ActiveWorkbook.SaveAs Filename:= _ "C:\Documents and Settings\Roger\Desktop\New File.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False ActiveWorkbook.Close End |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Save file as Cell Value
Your idea worked great.
Thanks so much for all your help. Roger "FSt1" wrote: hi this might work... Dim mypath As String Dim nrng As Range Dim fname As String Set nrng = Range("A1") mypath = "C:\your\file\path\" fname = nrng.Value & ".xls" ActiveWorkbook.SaveAs Filename:= _ mypath & fname, FileFormat:= _ xlNormal, Password:="", _ WriteResPassword:="", _ ReadOnlyRecommended:=False, _ CreateBackup:=False regards FSt1 "Roger" wrote: Hi Everyone, I have the below routine set to copy a page to my desktop. Is there a way to have it change the save name to a particular cell's value? If Range(€śL6€ť) equals a certain word, I would like it to save as that particular name. Thanks in advance for your thoughts - Roger Sub Finalstop() ActiveSheet.Copy ChDir "C:\Documents and Settings\Roger\Desktop" ActiveWorkbook.SaveAs Filename:= _ "C:\Documents and Settings\Roger\Desktop\New File.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False ActiveWorkbook.Close End |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autoname a save as file from a cell in a read only file | Excel Discussion (Misc queries) | |||
Save file with cell name | New Users to Excel | |||
Using "Save As" with a file name selected by cell | Excel Discussion (Misc queries) | |||
Save file as text from cell | Excel Discussion (Misc queries) | |||
Save a new file with the name that is in cell "C7" | Excel Discussion (Misc queries) |