Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
use part of date in cell for save as name
I have date in "A1" = 28/02/2008
I want to save worksheet as: "c:\ToCav0208m.csv" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
use part of date in cell for save as name
fullfilename = "C:\ToCav" & format$(day(Range("A1")),"00") & format$(year(Range("A1")),"00") "Helmut" wrote: I have date in "A1" = 28/02/2008 I want to save worksheet as: "c:\ToCav0208m.csv" |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
use part of date in cell for save as name
On 12 Mar, 14:20, Helmut wrote:
I have date in "A1" = 28/02/2008 I want to save worksheet as: "c:\ToCav0208m.csv" Dim saveName As String saveName = "C:\ToCav" & Format(Month(Range("A1").Value), "00") & Format(Range("A1").Value, "yy") & "m.csv" ThisWorkbook.SaveAs Filename:= saveName Above assumes A1 is correctly formatted as a date. -- Gordon |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
use part of date in cell for save as name
Dim WksToSave as worksheet
set wks = activesheet wks.copy 'to a new workbook with activesheet 'just overwrite the .csv file, don't give me a warning application.displayalerts = false .parent.saveas _ filename:="C:\tocav" & format(.range("a1").value, "mmyy") & "m.csv", _ fileformat:=xlcsv application.displayalerts = true .parent.close savechanges:=false end with Helmut wrote: I have date in "A1" = 28/02/2008 I want to save worksheet as: "c:\ToCav0208m.csv" -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
use part of date in cell for save as name
Typo:
Dim WksToSave as worksheet should be Dim Wks as worksheet (or change those wks to wkstosave) Dave Peterson wrote: Dim WksToSave as worksheet set wks = activesheet wks.copy 'to a new workbook with activesheet 'just overwrite the .csv file, don't give me a warning application.displayalerts = false .parent.saveas _ filename:="C:\tocav" & format(.range("a1").value, "mmyy") & "m.csv", _ fileformat:=xlcsv application.displayalerts = true .parent.close savechanges:=false end with Helmut wrote: I have date in "A1" = 28/02/2008 I want to save worksheet as: "c:\ToCav0208m.csv" -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search/Match/Find ANY part of string to ANY part of Cell Value | Excel Worksheet Functions | |||
formula to get the file save date in a cell? | Excel Programming | |||
Save As Part 2 | Excel Programming | |||
Save file using part of folder name | Excel Programming | |||
Replace part of link address in a cell with a value(date) from ano | Excel Discussion (Misc queries) |