reconciliation

  • Thread starter Thread starter shaharul
  • Start date Start date
S

shaharul

can anybody help with the VBA for comparing data in two worksheets and
delete the matching data or copy the data that cannot be matched
 
dim i as integer, j as integer
for i = 1 to maxrows
for j = 1 to maxcols
if sheets("Sheet1").cells(i,j) = sheets("Sheet2")_
.cells(i,j) then
sheets("Sheet1").cells(i,j).ClearContents
sheets("Sheet2").cells(i,j).ClearContents
endif
next j
next i


this deletes the data that is matched in both sheets.
John.
 
Back
Top