|
成功运行,存在问题: 1.请假如何解决(目前排除) 2.列,变量(已解决) 3.日期 4.日期和列匹配
Sub 匹配_备份() Application.ScreenUpdating = False Dim i, ii, iii, k, j For k = 3 To 22 If Cells(k, 2) = "" Then Else For i = 2 To 29 m = Cells(i, 22) '这里Sheet是关键,如果在别的页执行,必须有,否则为当页 If InStr(Cells(k, 2), m) > 0 Then '如果提取的数据包含m For ii = 2 To 8 n = Cells(ii, 23) If InStr(Cells(k, 2), n) > 0 Then For iii = 2 To 55 If m = Sheet2.Cells(iii, 2) And n = Sheet2.Cells(iii, 4) Then Sheet2.Cells(iii, 9) = Sheet1.Cells(k, 1) '写入部分 End If Next End If Next End If Next End If Next Sheets("Sheet2").Select 'Cells(iii, 9).Select Application.ScreenUpdating = True End Sub
|