Hey, I am kinda new at this. I am learning the program quickly but am stuck on this issue. Heres the situation. I am using a macro in Excel to import information from a varity of reports. I then import the Excel sheet into an Access database that stores and reexports the data in a varity of forms. If the info has an error when imported from excel I run into major problems. Duplicate info can not exsist. Information is only imported once a month and is always dated the first of the month. I would like a macro that will search for exact information in two cells.
example
reference---other data---other data---date
12344-------varies--------varies--------09/01/2005
12344-------varies--------varies--------09/01/2005
12345-------varies--------varies--------12/01/2005
12345-------varies--------varies--------12/01/2005
12344-------varies--------varies--------10/01/2005
12344-------varies--------varies--------10/01/2005
12344-------varies--------varies--------11/01/2005
12344-------varies--------varies--------12/01/2005
12345-------varies--------varies--------12/01/2005
I will use what ever I am given in for Access data base with two text boxes. The first I will type in the Reference # and in the second, the date.
12345 12/01/2005 in the boxes will delete all that have those values in them. The macro should be based off rows, I think. and only delete rows that match both text boxes. -no non matching rows above or below. The reference # and date may appear many times. 20+ and are not always in order. Also there may be spaces in some rows. I need an exact match to what I enter. only deleting what I enter. -very, very important. I can point the macro to the text boxes and assign a button. also this will need to work on 6 tables with one click. The button will be in a form and will need to point to 6 tables. Also the row will need to shift up. not just clear the cells because the other data in the row varies and will still cause errors once I reimport. Please help if you can. -Thanks David
example
reference---other data---other data---date
12344-------varies--------varies--------09/01/2005
12344-------varies--------varies--------09/01/2005
12345-------varies--------varies--------12/01/2005
12345-------varies--------varies--------12/01/2005
12344-------varies--------varies--------10/01/2005
12344-------varies--------varies--------10/01/2005
12344-------varies--------varies--------11/01/2005
12344-------varies--------varies--------12/01/2005
12345-------varies--------varies--------12/01/2005
I will use what ever I am given in for Access data base with two text boxes. The first I will type in the Reference # and in the second, the date.
12345 12/01/2005 in the boxes will delete all that have those values in them. The macro should be based off rows, I think. and only delete rows that match both text boxes. -no non matching rows above or below. The reference # and date may appear many times. 20+ and are not always in order. Also there may be spaces in some rows. I need an exact match to what I enter. only deleting what I enter. -very, very important. I can point the macro to the text boxes and assign a button. also this will need to work on 6 tables with one click. The button will be in a form and will need to point to 6 tables. Also the row will need to shift up. not just clear the cells because the other data in the row varies and will still cause errors once I reimport. Please help if you can. -Thanks David
Code: