用datevalue试试
附件里有示例
Sub ff()Dim a, b, cFor i = 1 To 2a = Cells(i, 1)b = Cells(i, 2)c = Cells(i, 3)If DateValue(c) - DateValue(a) > -1 And DateValue(c) - DateValue(b) >= 0 ThenCells(i, 4) = "Y"End IfNext iEnd Sub