Skip to content

Instantly share code, notes, and snippets.

@kureikei
Last active Aug 29, 2015
Embed
What would you like to do?
Sub calendar()
Row = 1
Col = Weekday(DateSerial(Year(Date), Month(Date), 1))
DaysOfMonth = Day(DateSerial(Year(Date), Month(Date) + 1, 0))
For Current = 1 To DaysOfMonth
Cells(Row, Col) = Current
Col = Col Mod 7 + 1
If Col = 1 Then Row = Row + 1
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment