Private Sub UserForm_Initialize()
Dim myRange As Range
Dim myCount As Long '件数
Dim X
Label3.Caption = Date '今日の日付
On Error Resume Next
'=======
'件数をチェック ◎
X = Date
Set myRange = Worksheets("単語帳").Range("C11:C65536")
myCount = Application.WorksheetFunction.CountIf(myRange, "=" & X)
If myCount = 0 Then
TextBox1.Text = "0件"
Else
TextBox1.Text = myCount & "件"
End If
End Sub
|