|
仮に Sheet2 の E列 を基準とするなら・・
Sub MyData_Copy()
Dim MyR As Range
On Error Resume Next
With Worksheets("Sheet2")
With .Range("E1", .Range("E65536").End(xlUp)).Offset(, 251)
.Formula = "=IF(Sheet1!$E1<>$E1,1,"""")"
Set MyR = .SpecialCells(3, 1)
End With
On Error GoTo 0
If Err.Number <> 0 Then
MsgBox "Sheet1のE列と違うデータはありません", 48
.Range("$IV:$IV").ClearContents: Exit Sub
End If
Worksheets("Sheet3").Cells.ClearContents
Intersect(MyR.EntireRow, .Range("$A:$IV")) _
.Copy Worksheets("Sheet3").Range("A1")
.Range("$IV:$IV").ClearContents
End With
Set MyR = Nothing
End Sub
|
|