I don't know why I'm getting a Type Mismatch error. I'm trying to do a simple subtraction macro with a variable row spreadsheet and getting a Type Mismatch error on this line of code: I'm subtracting two dates, column I which contains expiration date must cell "AA1" which contains today's date.
Range("M" & i).Value = Range("I" & i).Value - Range("AA1").Value
I'm subtracting two dates, column I which contains expiration date must cell "AA1" which contains today's date.
My macro is as follows:
'exception age calculation
Range("M1").Select
ActiveCell.FormulaR1C1 = "Days to Expiration"
Range("AA1").Value = Date
With Worksheets("Archer Search Report")
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To FinalRow
Range("M" & i).Value = Range("I" & i).Value - Range("AA1").Value
Next i
End With
Range("M" & i).Value = Range("I" & i).Value - Range("AA1").Value
I'm subtracting two dates, column I which contains expiration date must cell "AA1" which contains today's date.
My macro is as follows:
'exception age calculation
Range("M1").Select
ActiveCell.FormulaR1C1 = "Days to Expiration"
Range("AA1").Value = Date
With Worksheets("Archer Search Report")
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To FinalRow
Range("M" & i).Value = Range("I" & i).Value - Range("AA1").Value
Next i
End With