Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
formula to get the file save date in a cell? Gummby Excel Programming 7 March 11th 08 04:04 AM
Save As Part 2 el zorro[_2_] Excel Programming 2 July 19th 07 04:42 PM
Save file using part of folder name Object Excel Programming 6 May 1st 06 04:25 AM
Replace part of link address in a cell with a value(date) from ano Hakan Excel Discussion (Misc queries) 0 July 20th 05 12:39 PM


All times are GMT +1. The time now is 01:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"