I've been banging my head on this issue! I have a variable called `repDate` which today is equal to `"5/1/2020"` as a string. I've tried this formula to convert it to a `Long` so I can compare it to a date in the file `rDtLng = CLng(repDate)`. I'm getting error "Type Mismatch" which I am not sure why there would be one. This is where I am doing the comparing the rest works great, just the report date as long doesn't want to work.

```
'repDate equals "5/1/2020", currently

rDtLng = CLng(repDate)
.
.
.
'Delete charge offs
 For w = rwCnt To 3 Step -1
     Do While .Cells(w, napbRng.Column).Value2 <= 0 And .Cells(w, apbRng.Column).Value2 <= 0
         If .Cells(w, matDtRng.Column).Value2 = "" Then Exit Do
         If .Cells(w, matDtRng.Column).Value2 < rDtLng Then
             .Rows(w).Delete shift:=xlShiftUp
         Else: Exit Do
         End If
     Loop
Next w

```

Thanks in advance!
['https://Stackoverflow.com/questions/61545026', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8396248/']
`CLng` expects a numeric input, which the *text-that-looks-like-a-date* `"5/1/2020"` is not.

You can convert that to an actual date using `CDate` and then perform mathematical operations on it, including the existing `<` comparison.

Though if I understand what your end goal is, you might consider `Range.AutoFilter` with a date filter, and then deleting visible rows, instead of your current `Do` loop approach.

*Side note*: you could `CLng(CDate("5/1/2020"))` and the result would be `43952`, but that's an unnecessary step, as you can do math with dates directly.
Use DateValue() Function.

```
Sub test()
    Dim myDate As Long
    Dim str As String

    str = "5/1/2020"
    myDate = DateValue(str)

    If myDate = DateSerial(2020, 5, 1) Then
        MsgBox "OK"
    End If

End Sub

```