Excel formula for previous year

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,362
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Is there an excel function for the previous year?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
There is another way I could solve this. I have this code
Code:
    With Workbooks(newDoc)
        .Sheets("July " & Range("E18")).Name = "July " & Year(Now) + 1

E18 has the current year and when I created it, last year, it all worked but the button will be clicked at the end of the financial year, which is this year, so I need a way to make the year in E18 to be the previous year. I could change the formula in E18 to reflect the previous year, which I don't know how to do or I could update the code in vba, probably the above line, to reflect the previous year, which I also don't know how to do. Could someone help me please?

I somehow need to make Range("E18") the previous year but I don't know the syntax. I was thinking Range("E18")-1 but that won't work.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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