how to add next month using this formula

  • Thread starter Thread starter Legacy 185509
  • Start date Start date
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
Code:
=DATE(YEAR('D1'), MONTH('D1')+1, DAY('D1'))
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...

Code:
Sub NextMonth()
    Range("D1").FormulaR1C1 = "=DATE(YEAR(D1), MONTH(D1)+1, DAY(D1))"
    'Range("D2").FormulaR1C1 = Range("D2")
End Sub
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
they nice and short formula, even better :)
but how can I make Macro which will use this formula to change to next month
I am putting in loop I want it to change 3 times
so 3 months
plz help
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top