• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Place Current Month Number in Certain Sheet Cell

JenniferS

Member
Hi,

Is there VBA that can Open Workbook to certain sheet and change a certain cell value on that sheet to the current month's number?
I would like the workbook to open to the sheet called 'Calendar' and the cell E6 to contain the current month's number which would be "6" for this month of June.

Thank you
 

Belleke

Well-Known Member
Code goes in ThisWorkbook Event
Code:
Private Sub Workbook_Open()
With Sheets("Calendar")
    .Select
    .Range("E6").Value = Month(Date)
End With
End Sub
 

JenniferS

Member
Thanks so much it works great! At first I had the cell formatted as a date which is incorrect. I changed to general format and it works now.
 
Top