I would like some vba code How do I enter in a cell some vba code that shows the previous month and current year. Example if doing today it would be
Feb- 2010.
Many Thanks
I would like some vba code How do I enter in a cell some vba code that shows the previous month and current year. Example if doing today it would be
Feb- 2010.
Many Thanks
[VBA]Sub LastMonth()
ActiveCell = Format(DateSerial(Year(Date), Month(Date) - 1, 1), "mmm-yy")
End Sub
[/VBA]
or
=DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)
and format as required.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
perfect thanks, !!