LoginSignup
0
1

More than 3 years have passed since last update.

月の日数の求め方

Last updated at Posted at 2020-02-11

月の日数の求め方

むかし書き溜めたVBAのTips

月の日数を調べるには、翌月の初日の前日が調べたい月の最終日となることを利用して調べる(C6の日付の月の日数を表示する)。

Private Sub CommandButton1_Click()
 MsgBox Day(DateSerial(Year(Range("C6")), Month(Range("C6")) + 1, 0))
End Sub

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1