Skip to content

Instantly share code, notes, and snippets.

@wheeliechamp
Created February 11, 2020 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wheeliechamp/123af4b6ae061b128ae2849330871279 to your computer and use it in GitHub Desktop.
Save wheeliechamp/123af4b6ae061b128ae2849330871279 to your computer and use it in GitHub Desktop.
月の日数を取得する
月の日数を調べるには、翌月の初日の前日が調べたい月の最終日となることを利用して調べる(C6の日付の月の日数を表示する)。
Private Sub CommandButton1_Click()
MsgBox Day(DateSerial(Year(Range("C6")), Month(Range("C6")) + 1, 0))
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment