Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,839 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello All, Using Office16. I have been using this macro for many years, and suddenly it is giving me a runtime error 13 mismatch. I have not changed anything on my spreadsheet, or in the macro before it stopped working. Any help would be greatly appreciated. Thanks.
Sub ACCU_Pay_By_Date_1()
Dim oRng As Range
Dim i As Long
Dim dblRes As Double
Set oRng = Range("E2:E69")
For i = 1 To oRng.Cells.Count
If oRng(i).Font.ColorIndex = 15 And CDbl(oRng(i).Offset(0, -1)) <= CDbl(Range("D96")) Then
If InStr(oRng(i).Offset(0, 1), ChrW(8730)) = 0 Then
dblRes = dblRes + oRng(i)
End If
End If
Next i
Application.EnableEvents = False
Range("D92") = dblRes
Application.EnableEvents = True
End Sub