L
Legacy 185509
Guest
Hi
this formula will generate next month
if cell D1 = 5/1/2011
and if you put this formula in E1
we will get 6/1/2011
I want to know how can I use this formula to change month on D1
like
First it will may than it will June and soo on...
this formula will generate next month
if cell D1 = 5/1/2011
and if you put this formula in E1
Code:
=DATE(YEAR('D1'), MONTH('D1')+1, DAY('D1'))
I want to know how can I use this formula to change month on D1
like
First it will may than it will June and soo on...
Code:
Sub NextMonth()
Range("D1").FormulaR1C1 = "=DATE(YEAR(D1), MONTH(D1)+1, DAY(D1))"
'Range("D2").FormulaR1C1 = Range("D2")
End Sub