M
Maxi
I have dates in range G7:N7 in the format d-mmm but the below code
doesn't go inside the "Do something" state, it says Date not found even
if I put in a date which is present in the G7:N7 range.
Can anybody help?
Sub foo()
Dim ws1 As Worksheet
Dim dDt As String
Set ws1 = Sheets("Sheet1")
dDt = Application.InputBox("Enter Date", "Schedule Date", "m/d/yyyy")
Application.ScreenUpdating = False
If dDt = vbNullString Then
Exit Sub
End If
dDt = Format(dDt, "d-mmm")
If Application.WorksheetFunction.CountIf(ws1.Rows(7), dDt) > 0 Then
doesn't go inside the "Do something" state, it says Date not found even
if I put in a date which is present in the G7:N7 range.
Can anybody help?
Sub foo()
Dim ws1 As Worksheet
Dim dDt As String
Set ws1 = Sheets("Sheet1")
dDt = Application.InputBox("Enter Date", "Schedule Date", "m/d/yyyy")
Application.ScreenUpdating = False
If dDt = vbNullString Then
Exit Sub
End If
dDt = Format(dDt, "d-mmm")
If Application.WorksheetFunction.CountIf(ws1.Rows(7), dDt) > 0 Then