|
楼主 |
发表于 2022-12-13 17:41
|
显示全部楼层
谢谢!调了一下还是不行
Sub Macro00()
'
Dim ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet
Dim i As Long, j As Long
Dim newSheetPos As Integer
Set ws1 = ActiveWorkbook.Sheets("Sheet1")
Set ws2 = ActiveWorkbook.Sheets("Sheet2")
Set ws3 = ActiveWorkbook.Sheets("Sheet3")
For i = ws1.Cells(ws1.Rows.Count, 1).End(xlUp).Row To 2 - 1
For j = 2 To ws2.Cells(ws2.Rows.Count, 1).End(xlUp).Row
If Trim(ws1.Cells(i, 1).Value) = Trim(ws2.Cells(j, 1).Value) Then
Rows("i:i").Select
Selection.Delete Shift:=xlUp
End If
Next j
Next i
End Sub |
|