A
Aussie_Bob_C
Version: 2004
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
I'm trying to check date in cell G3 with a =today() date in cell B3.
If date in G3 is greater than cell B3 do nothing.
Else if date in cell G3 is less than or equal to cell B3 run Sub PlusOneMonth() macro which increases cell G3 date by 1 calendar month.
Sub PlusOneMonth()
Dim dt As Date
Dim mnth As Long
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
dt = Range("G3").Value
mnth = Month(dt)
If Day(dt) >= 17 Then mnth = mnth + 1
[G3].Value = DateSerial(Year(dt), mnth, 17)
Application.Calculation = xlCalculationAutomatic
End Sub
TIA
Aussie Bob C
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
I'm trying to check date in cell G3 with a =today() date in cell B3.
If date in G3 is greater than cell B3 do nothing.
Else if date in cell G3 is less than or equal to cell B3 run Sub PlusOneMonth() macro which increases cell G3 date by 1 calendar month.
Sub PlusOneMonth()
Dim dt As Date
Dim mnth As Long
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
dt = Range("G3").Value
mnth = Month(dt)
If Day(dt) >= 17 Then mnth = mnth + 1
[G3].Value = DateSerial(Year(dt), mnth, 17)
Application.Calculation = xlCalculationAutomatic
End Sub
TIA
Aussie Bob C