If a = Sheets("工作表1").Cells(j, 4).Value Then b = Left(Sheets("工作表1").Cells(j, 3), 2) For x = 2 To C If b = Sheets("工作表2").Cells(1, x) Then d = Sheets("工作表1").Cells(j, 5) - Sheets("工作表1").Cells(j, 4) + 1 z = i While d > 0
Sheets("工作表2").Cells(z, x).Value = Sheets("工作表1").Cells(j, 2) z = z + 1 d = d - 1