![]() |
Save a File with a cell value
I have set my Excel file to save to a aprticular location, however I want to
be able to have the filename made up from the value in a worksheet cell i.e. Currently I have ChDir "C:\REPORTS" ActiveWorkbook.SaveAs Filename:="C:\REPORTS\mailinglist.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False I want where the file name is mailinglist.xsl to be populated by a value from a cell i.e. colleges21092005.xls (cellvalue+currentdate+filetype) Any pointers would be greatly appreciated! Tia |
Save a File with a cell value
Put
"C:\REPORTS\" & Range("A1").Value & Replace(Date, ".", "") & ".xls" in place of the filename! Substitute "A1" with the cell reference you want to get the name from! Regards, Stefi €˛Jonathan€¯ ezt Ć*rta: I have set my Excel file to save to a aprticular location, however I want to be able to have the filename made up from the value in a worksheet cell i.e. Currently I have ChDir "C:\REPORTS" ActiveWorkbook.SaveAs Filename:="C:\REPORTS\mailinglist.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False I want where the file name is mailinglist.xsl to be populated by a value from a cell i.e. colleges21092005.xls (cellvalue+currentdate+filetype) Any pointers would be greatly appreciated! Tia |
Save a File with a cell value
simpler to use Format for date, no international issues then, and better to
format as yyyymmdd for sorting purposes Format(Date, "yyyymmdd") -- HTH Bob Phillips "Stefi" wrote in message ... Put "C:\REPORTS\" & Range("A1").Value & Replace(Date, ".", "") & ".xls" in place of the filename! Substitute "A1" with the cell reference you want to get the name from! Regards, Stefi "Jonathan" ezt ķrta: I have set my Excel file to save to a aprticular location, however I want to be able to have the filename made up from the value in a worksheet cell i.e. Currently I have ChDir "C:\REPORTS" ActiveWorkbook.SaveAs Filename:="C:\REPORTS\mailinglist.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False I want where the file name is mailinglist.xsl to be populated by a value from a cell i.e. colleges21092005.xls (cellvalue+currentdate+filetype) Any pointers would be greatly appreciated! Tia |
Save a File with a cell value
Yeees, I forgot that I have a specific default date format with "."s!
Stefi €˛Bob Phillips€¯ ezt Ć*rta: simpler to use Format for date, no international issues then, and better to format as yyyymmdd for sorting purposes Format(Date, "yyyymmdd") -- HTH Bob Phillips "Stefi" wrote in message ... Put "C:\REPORTS\" & Range("A1").Value & Replace(Date, ".", "") & ".xls" in place of the filename! Substitute "A1" with the cell reference you want to get the name from! Regards, Stefi "Jonathan" ezt Ć*rta: I have set my Excel file to save to a aprticular location, however I want to be able to have the filename made up from the value in a worksheet cell i.e. Currently I have ChDir "C:\REPORTS" ActiveWorkbook.SaveAs Filename:="C:\REPORTS\mailinglist.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False I want where the file name is mailinglist.xsl to be populated by a value from a cell i.e. colleges21092005.xls (cellvalue+currentdate+filetype) Any pointers would be greatly appreciated! Tia |
All times are GMT +1. The time now is 12:13 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com