Sub Compare()
Dim TB1 As Worksheet, TB2 As Worksheet
Dim R1%, R2%, i%, y%
Set TB1 = Workbooks("testbook1.xls").Worksheets(1) 'You added the file
name
Set TB2 = Workbooks("testbook2.xls").Worksheets(1) 'You added the file
name
R1 = TB1.Cells(Rows.Count, 1).End(xlUp).Row
R2 = TB2.Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To R1
For y = 1 To R2
If TB1.Cells(i, 1) = TB2.Cells(y, 1) Then
TB2.Cells(y, 1) = "Match" 'puts match
in A column
Exit For
End If
Next y
Next i
End Sub
Now you will need something to put the contents in the cell after you compare.
YOu need to move to that column.
ActiveCell.Offset(0, 25).Range("A1").Select '25 moves from A over to Z
PayAppQty= ActiveCell.FormulaR1C1 'content of Z cell placed in
payappqty
then move back...
ActiveCell = PayAppQty
Place this last bit of code in your sub as needed to fit your files.
"theargus@gmail.com" wrote:
> Bump
>
>
Bookmarks