Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2007 Macro to Open File, Delete Contents, Save New File | Excel Discussion (Misc queries) | |||
Macro to save Excel file with date and time in the file name? | Excel Programming | |||
Macro to call a file that has a auto open macro in the file itself | Excel Programming | |||
Automate open file, update links, run macro, close and save file | Excel Programming |