|
条件:
Sheet1=表1・Sheet2=表2 と仮定
1行目が項目・2行目以下がデータ と仮定
Sheet1のAA:AC列を作業列とする。
Sub UnMatch_Data()
Dim LsR As Long
LsR = Worksheets("Sheet2").Range("A65536").End(xlUp).Row
Application.ScreenUpdating = False
With Worksheets("Sheet1")
Application.Goto .Range("A1"), True
.Rows.Hidden = False
.Range("AA:AC").ClearContents
.Range("AA2", .Range("A65536").End(xlUp).Offset(, 26)) _
.Formula = "=$A2&$B2"
.Range("AB2:AB" & LsR).Formula = "=Sheet2!$A2&Sheet2!$B2"
On Error Resume Next
With .Range("AC2", .Range("A65536").End(xlUp).Offset(, 28))
.Formula = "=MATCH($AA2,$AB:$AB,0)"
.SpecialCells(3, 1).EntireRow.Hidden = True
End With
.Range("AA:AC").ClearContents
End With
Application.ScreenUpdating = True
End Sub
|
|