DataTables("数据表").datarows.clear() For Each dr As DataRow In DataTables("人员表").DataRows If dr.IsNull("人员编号") Then Continue For Dim vr As DataRow If dr("工作方式") = "宣传员" Then vr = DataTables("宣传员").DataRows(0) Else vr = DataTables("宣传员").DataRows(0) End If Dim ld As Date = dr("第一次收益时间") For Each dc As DataCol In vr.DataTable.DataCols Dim dr2 As DataRow = DataTables("数据表").AddNew() dr2("人员编号") = dr("人员编号") dr2("人员姓名") = dr("人员姓名") dr2("完成点位") = dr("完成点位") dr2("工作方式") = dr("工作方式") dr2("收益日期") = ld dr2("收益金额") = dr("完成点位") * vr(dc.name) ld = ld.AddDays(5) If ld.day = 4 Then ld = ld.AddDays(1) Else If ld.day = 1 Or ld.Day = 2 Then ld = ld.AddDays(-ld.day) End If Next Next