If I'm understanding your requirements correctly, you're almost there...
Public Function ColorValueOfDateComparison(datCheck1 as Date, datCheck2 as Date) as Long
Dim datToday as date
Dim lngDiffer as long, _
lngRed as Long, _
lngYellow as long, _
lngGreen as long, _
lngBlack as long...