Need Help with checking records

  • Thread starter Thread starter Charles
  • Start date Start date
C

Charles

Good Morning
I need help or an idea a user gets a excel workbook from a
programme called smartstream which shows records that has
changed, I has written code to check for new records and
write them to an access table I also need to check if
records have changed if so update that record in the
table. The problem is that a record number can be in the
db more than once, the records has a ID with autonumber on
but not in the excel sheet. any help will be much
appricated.
Charles
 
if you sort the column with the ID's then you can simply
test & delete.

The following code assumes the ID is in column "A" and
deletes matches

dim thisrow as long
dim IDColumn as string
IDColumn ="A"
For thisrow = Range("A65000").End(xlUp).Row to 2 step -1

Do While Cells(thisrow,IDColumn).Value = _
Cells(thisrow-1,IDColumn).Value
Rows(thisrow).Delete
Loop

Next thisrow


The Do-Loop is req'd since a deleted row then requires
the test to be done again.

Patrick Molloy
Microsoft Excel MVP
 
Back
Top