Sub findsame()
Set mysheet1 = Workbooks("A.xls").Sheets(1)
Set mysheet2 = Workbooks("B.xls").Sheets(1)
'find lastcell and lastcolumn in A
Alastcell = mysheet1.Range("a1").End(xlDown).Row
Alastcolumn = mysheet1.Range("a1").End(xlToRight).Column
' find lastcell and lastcolumn in B
Blastcell = mysheet2.Range("a1").End(xlDown).Row
Blastcolumn = mysheet2.Range("a1").End(xlToRight).Column
For i = 1 To Alastcell
For j = 1 To Alastcolumn
For m = 1 To Blastcell
For k = 1 To Blastcolumn
If mysheet1.Cells(i, j).Value = mysheet2.Cells(m, k).Value Then
mysheet1.Cells(i, j).Value = "#####"
GoTo forj
End If
Next k
Next m
forj:
Next j
Next i
End Sub
Sub Makro1()
For Each x In Workbooks("B.xls").Sheets(1).Cells
Workbooks("A.xls").Sheets(1).Cells.Replace What:=x, Replacement:="", LookAt:=xlWhole
Next
End Sub
Sub Makro1()
Set A_usedArea = Workbooks("A.xls").Sheets(1).UsedRange
Set B_usedArea = Workbooks("B.xls").Sheets(1).UsedRange
Set C_usedArea = Workbooks("C.xls").Sheets(1).UsedRange
For Each x In B_usedArea
A_usedArea.Replace What:=x, Replacement:="", LookAt:=xlWhole, MatchCase:=True
Next
For Each x In C_usedArea
A_usedArea.Replace What:=x, Replacement:="", LookAt:=xlWhole, MatchCase:=True
Next
End Sub