Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click
Dim Date1 As Date Dim Date2 As Date Dim DCount As Long
If IsDate(TextBox1.Text) Then Date1 = CDate(TextBox1.Text) Else MsgBox( _ "「から」の日付を正しく入力してください yyyy/mm/dd") TextBox1.SelectAll() TextBox1.Focus() Exit Sub End If If IsDate(TextBox2.Text) Then Date2 = CDate(TextBox2.Text) Else MsgBox( _ "「まで」の日付を正しく入力してください yyyy/mm/dd") TextBox2.SelectAll() TextBox2.Focus() Exit Sub End If