Excel/Macro to insert date
Expert: Adelaide carvalho - 10/23/2009
QuestionI want a macro that will insert date of last month (mm/yy) by taking the current date from the system in cell B4 of PG_results sheet
AnswerHi Imran
How are you?
Please see below
Sub LastMonth()
Dim R As Range, F As Date, F1 As Date
Set R = Sheets(1).Range("C4")
F = R.Cells(1, 1).Offset(0, -1)
F1 = F - 31
R.Cells(1, 1) = F1
R.Cells(1, 1).NumberFormat = "[$-816]mmm/yy;@"
End Sub
Cheers
adelaide
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your
Excel question answered in this area then please ask an Excel question here