Checking for Duplicate Data in Worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database (workbook) of customers who come into my store every month.
I divided my workbook into many worksheets. All of the worksheets contain
the same row and column headings and are clones of each other except for the
data.
We update the data twice a month and the worksheets are divded to represent
specific dates.

I need to macro that will flag me upon a duplicate entry, and/or insert a
marker in an adjacent column that indicates the customer is already shown on
another worksheet within that same workbook. The fields (columns) that need
to be checked prior to notification/marking are, Lname, Fname, Phone.

Is this doable?
 
Try this: (you may have to correct syntax, as I just wrote this and
didn't test it)

For Each Sheet1cell in Sheets("Sheet1").Range("A2:A100")
int1Count = Sheet1cell.Rows.Count
1FirstLast = Sheet1cell & Sheets("Sheet1").Cells _(int1Count, "B")
For Each Sheet2cell in Sheets("Sheet2").Range("A2:A100")
int2Count = Sheet2cell.Rows.Count
2FirstLast = Sheet2cell & Sheets("Sheet2").Cells _(int2Count, "B")
If 1FirstLast = 2FirstLast then
response = msgbox("DUPLICATE SHEET1 row " & _
int1Count & " Sheet2 row " & int2Count
End If
Next Sheet2cell
Next Sheet1cell
 
Dear Claud,

Thank you very much for your help. I will run the macro and advise you if
it works.

Judy Stark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top