I\'m trying to make a comparison between years from two dates (in different columns) and the current year date. If the year is the same then it should write on the correspon
Try this:
Dim date1 As Date, date2 As Date
Set value for variable
date1 = ws1.Cells(j, 9) date2 = ws1.Cells(j, 12)
Use variable in your If statement
If
If Year(date1) = Year(Date) Or Year(date2) = Year(Date) Then