做个按钮,执行代码
For Each dr As DataRow In DataTables("表A").datarows Dim d As Date = dr("有效期") If d <> Nothing Then dr("日期") = d.AddYears(-4).AddDays(-1) Else dr("日期") = Nothing End IfNext