Dim sts() As String ={"项目管理表","项目主线","主线任务"} For Each st As String In sts For Each dr As DataRow In DataTables(st).DataRows If dr.IsNull("计划完工日期") = False Then If dr("计划完工日期").AddDays(-6)> Date.Today() OrElse dr.IsNull("实际完工日期") = False Then dr("任务提醒") = "正常" ElseIf dr("计划完工日期") < Date.Today() dr("任务提醒") = "超期" ElseIf dr("计划完工日期").AddDays(-6)<=Date.Today() AndAlso dr("计划完工日期") >= Date.Today() dr("任务提醒") = "即将到期" End If End If Next Next