Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
lee lee is offline
external usenet poster
 
Posts: 184
Default Svae file within macro

How do I save a file automaticaly with a variable file name. Eg I want to
save a file twice a day at the end of each shift (info to be contained within
an established macro) with the date as a file name with am or pm added to the
end to signify which shift the info is from.

Can anyone help please???
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Svae file within macro


Sub FileSave()
Dim D As Variant
Dim T As Variant
[D] = Format(Date, "mm-dd-yyyy")
If Time = "12:00 PM" Then
[T] = "PM"
End If
If Time <= "12:00 AM" Then
[T] = "AM"
End If

ThisWorkbook.SaveAs Filename:="" & [D] & " " & [T] & ""

End Sub


--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=538238

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Svae file within macro


I would like something very similar.

I would like it to save using the date of the wages fortnight.

I would like mine to save with "FNE " then the date like in the e
which is in cell named "PAY_PERIOD" which is C5 in Balance sheet.
eg
"FNE 07_03_05.xls"
"FNE 07_17_05.xls"
"FNE 07_31_05.xls

--
XCESI
-----------------------------------------------------------------------
XCESIV's Profile: http://www.excelforum.com/member.php...fo&userid=2427
View this thread: http://www.excelforum.com/showthread.php?threadid=53823

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Svae file within macro


How do i get d to = a cell in the workbook


--
XCESIV
------------------------------------------------------------------------
XCESIV's Profile: http://www.excelforum.com/member.php...o&userid=24271
View this thread: http://www.excelforum.com/showthread...hreadid=538238

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Svae file within macro

dim myFileName as string
myfilename = "c:\yourpathhere\" & "FNE" _
& format(worksheets("balance").range("C5").value, "dd_mm_yyyy") _
& ".xls"

activeworkbook.saveas filename:=myfilename, fileformat:=xlworkbooknormal

XCESIV wrote:

I would like something very similar.

I would like it to save using the date of the wages fortnight.

I would like mine to save with "FNE " then the date like in the eg
which is in cell named "PAY_PERIOD" which is C5 in Balance sheet.
eg
"FNE 07_03_05.xls"
"FNE 07_17_05.xls"
"FNE 07_31_05.xls"

--
XCESIV
------------------------------------------------------------------------
XCESIV's Profile: http://www.excelforum.com/member.php...o&userid=24271
View this thread: http://www.excelforum.com/showthread...hreadid=538238


--

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
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Macro to save Excel file with date and time in the file name? sonic_d_hog Excel Programming 2 January 5th 06 05:57 PM
Macro to call a file that has a auto open macro in the file itself [email protected] Excel Programming 1 August 5th 05 06:39 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 10:14 PM.

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"