ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   tomorrow's date (https://www.excelbanter.com/excel-programming/275941-re-tomorrows-date.html)

J.E. McGimpsey

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




All times are GMT +1. The time now is 01:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com