Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have the following Macro, which saves the file to the entry in Cell AG13. The Cell AG13 is formatted as a date and I would like to use the macro but cannot format the filename as a date, when I try it saves as “False.xls” Range("ag13").Select savename = ActiveCell.Value & ".xls " ActiveWorkbook.SaveAs Filename:= _ "C:\" & savename, _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False Any help would be appreciated. -- Donkin ------------------------------------------------------------------------ Donkin's Profile: http://www.excelforum.com/member.php...o&userid=23715 View this thread: http://www.excelforum.com/showthread...hreadid=376258 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
savename = Format(ActiveCell.Value,"yyyymmdd") & ".xls "
-- HTH Bob Phillips "Donkin" wrote in message ... I have the following Macro, which saves the file to the entry in Cell AG13. The Cell AG13 is formatted as a date and I would like to use the macro but cannot format the filename as a date, when I try it saves as “False.xls” Range("ag13").Select savename = ActiveCell.Value & ".xls " ActiveWorkbook.SaveAs Filename:= _ "C:\" & savename, _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False Any help would be appreciated. -- Donkin ------------------------------------------------------------------------ Donkin's Profile: http://www.excelforum.com/member.php...o&userid=23715 View this thread: http://www.excelforum.com/showthread...hreadid=376258 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() How is the date formatted in the cell? If it has any /'s in it then it may not be valid as a filename. You could try something like this. Code ------------------- savename = Format(Range("ag13").Value, "ddmmyyyy") ------------------- -- Nori ----------------------------------------------------------------------- Norie's Profile: http://www.excelforum.com/member.php...fo&userid=1936 View this thread: http://www.excelforum.com/showthread.php?threadid=37625 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You can't have "/" in your filename and since these are likely to be i your date you can't have them. If your date is in cell B4, you could try this: FileName = Range("B4").value FileName = replace(Filename,"/","") activeworkbook.saveas filename & ".xls -- FastOneBa ----------------------------------------------------------------------- FastOneBaz's Profile: http://www.excelforum.com/member.php...nfo&userid=973 View this thread: http://www.excelforum.com/showthread.php?threadid=37625 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
set filename to <filename-date on open | Excel Worksheet Functions | |||
Appending filename with date | Excel Programming | |||
date in filename | Excel Programming | |||
Saving with date in filename | Excel Programming | |||
Inserting Date In Filename Using Macro | Excel Programming |