Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try
x = Format(Date - 7, "mm - dd - yy") y = Format(Date - 1, "mm - dd - yy") Putting in "" worked for me on asimilar thing "CV323" wrote: Thanks Tom. It works, except that the dates are not coming up as mm-dd-yy instead mm/dd/yy and it won't save the file. What do you suggest? This is how it reads now: Dim wb As Workbook Dim ws As Worksheet Dim x As Date Dim y As Date Dim strFileName As String Set wb = ActiveWorkbook Set ws = wb.Worksheets("idrmterm") x = Format(Date - 7, mm - dd - yy) y = Format(Date - 1, mm - dd - yy) Dim strPath As String strPath = "H:\REPORTS\Every Monday Reports\" strFileName = x & " " & y & ws.Name & ".xls" ActiveWorkbook.SaveAs Filename:=strPath & strFileName Set wb = Nothing Set ws = Nothing Application.Dialogs(xlDialogSendMail).Show ActiveWorkbook.Close |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to change 2006 calendar to 2007 and save dates in Excel | Excel Discussion (Misc queries) | |||
Disable save, save as, but allow save via command button | Excel Programming | |||
How to diasble save and save as menu but allow a save button | Excel Programming | |||
How to create command button to save the dates and time | Excel Discussion (Misc queries) | |||
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: | Excel Programming |