|
こんにちは
参考までに。
Sub Test_1()
Dim R As Range, R1 As Range, C As Range, Ch As Boolean
Ch = True
Set R = Worksheets("Sheet1").Cells.SpecialCells(xlCellTypeConstants)
Set R1 = Worksheets("Sheet2").Cells.SpecialCells(xlCellTypeConstants)
If R.Count <> R1.Count Then
Ch = False
GoSub End_Len
End If
For Each C In R
If C.Value <> Worksheets("Sheet2").Range(C.Address).Value Then
Ch = False
GoSub End_Len
End If
Next C
End_Len:
If Ch = False Then
Application.DisplayAlerts = False
Worksheets("Sheet2").Delete
Application.DisplayAlerts = True
End If
Set R = Nothing: Set R1 = Nothing
End Sub
|
|