|
▼熊 さん:
とりあえず、↑の解釈で。
以下で試してみてください。
Sub subTenki(theBook As Workbook)
Dim thetbl As Range, LRow As Long
Dim strA As Variant, strB As Variant
Dim c As Range
Dim cellA As String
Dim cellB As String
Set thetbl = theBook.Sheets(1).Range("A3:B6")
With ThisWorkbook.ActiveSheet
LRow = .Range("A" & .Rows.Count).End(xlUp).Row
If LRow = 1 Then
.Range("A2").Resize(thetbl.Rows.Count, thetbl.Columns.Count).Value = thetbl.Value
Else
cellA = .Range("A3:A" & LRow).Address
cellB = .Range("B3:B" & LRow).Address
LRow = LRow + 1
For Each c In thetbl.Columns(1).Cells
strA = c.Value
strB = c.Offset(, 1).Value
If Not Evaluate("=SUMPRODUCT((" & cellA & "=""" & strA & """)*(" & _
cellB & "=""" & strB & """))=1") Then
.Cells(LRow, "A").Resize(, 2).Value = c.Resize(, 2).Value
LRow = LRow + 1
End If
Next
End If
End With
End Sub
|
|