Hi,
I have simply for loop as below:
And I got Run-Time error'13': Type mismatch. (on line: r_year = Year(ws.Range("S" & i).Value))
Can you help me?
I have simply for loop as below:
Code:
Dim r_year, r_month As Date
Dim i, rows_x As Long
rows_x = ws.Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To rows_x
If ws.Range("A" & i).Value = looking_date Then
r_year = Year(ws.Range("S" & i).Value)
r_month = Month(ws.Range("S" & i).Value)
End If
Next i
And I got Run-Time error'13': Type mismatch. (on line: r_year = Year(ws.Range("S" & i).Value))
Can you help me?