Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am using the following code to automatically do a saveas process to have my file save as filename_date_time.xls. Sub SaveAs2() ' Dim irdate Dim irtime Application.ScreenUpdating = False Application.DisplayAlerts = False irdate = Month(Now) & Day(Now) & Year(Now) 'Format(Date,"mmddyy") irtime = FormatDateTime(Round(Time * 24, 0.1) / 24, vbShortTime) 'Format(Time,"hhmm") irtime = Hour(Now) & Minute(Now) 'could this line be the problem? On Error Resume Next ActiveWorkbook.SaveAs "H:\" & "PassCounts_" & irdate & "_" & irtime & ".xls" Application.ScreenUpdating = True Application.DisplayAlerts = True End Sub The problem I am having is in the time format. For 12:00 it should show _1200.xls but I am getting _120.xls instead. Can someone help me with properly formating the time for doing this file saveas process? I'm sure it is somthing simple but it just keeps illuding me. Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto Naming Worksheets | Excel Discussion (Misc queries) | |||
Auto naming Worksheets | Excel Discussion (Misc queries) | |||
Auto file naming | Excel Discussion (Misc queries) | |||
Auto naming worksheets | Excel Discussion (Misc queries) | |||
Check cells for 'Auto Save As' file naming | Excel Programming |