Skip to content

Instantly share code, notes, and snippets.

@kureikei
Last active August 29, 2015 14:07
Show Gist options
  • Save kureikei/2bbb5424e0e2c0eea85f to your computer and use it in GitHub Desktop.
Save kureikei/2bbb5424e0e2c0eea85f to your computer and use it in GitHub Desktop.
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