ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need Help with checking records (https://www.excelbanter.com/excel-programming/289537-need-help-checking-records.html)

Charles

Need Help with checking records
 
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

patrick molloy

Need Help with checking records
 
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



-----Original Message-----
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
.



All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com