Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
tomorrow's date
One way:
Replace Now() (which doesn't need the parentheses in VBA) with Date + 1 In article , "stat" wrote: I use the following code to write code to create a text file that eventually becomes a batch file to run an automated process. how can I specify tomorrow's date instead of today? thanks again Sub MakeMy_Code() Dim Command Sheets("Sheet1").Select Call mk_symb Sheets("Sheet2").Select Call mk_symb If Day(Now()) < 10 Then Range("A1") = "0" & Day(Now()) Else Range("A1") = Day(Now()) End If If Month(Now()) < 10 Then Range("A2") = "0" & Month(Now()) Else Range("A2") = Month(Now()) End If Sheets("Sheet1").Select Range("A1") = "@echo off" Range("a2") = "cls" Range("a3") = "ren q:\Backupddmm.zip backup" & Range("'Sheet2'!A1") & Range("'Sheet2'!a2") & ".zip" Call Save 'tells Excel the workbook is saved then quits Excel ActiveWorkbook.Saved = True Application.Quit End Sub Sub mk_symb() Cells.Select Range("D7").Clear Range("B6").Select Columns("A:A").NumberFormat = "@" Range("A1").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula to return tomorrow's date. | New Users to Excel | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
tomorrow's date on an invoice made today | New Users to Excel | |||
Report Date - Date Recv = Days Late, but how to rid completed date | Excel Worksheet Functions | |||
Date updates from worksheet to chart & changes date to a date series! Help!! | Charts and Charting in Excel |