importing data - check if already exist replace or else insert in the bottom

Hawjeen

New Member
Joined
Feb 23, 2018
Messages
23
Hi,

I got a task that are a bit over my current vba skills, and i was hoping that someone could help me out.

i need to import some data regulary and update a database.

what my need is, to check if the data in column A in sheet2 (new data) already is in column A in data (database).

if yes it should check if the value in column sheet2.R=data.R, if that is not the case, i would like it to replace the values from A:R. If it is the same it can just go to next value in sheet2.column A.

if the value in sheet2.column A dosent exist, i want to copy values from A:R and insert in the bottom of my table in sheet.data.

i hope this is understandeable, and that someone can save me from a lot of manual work in the future.
 
Glad to help & thanks for the feedback
Hi

This code works great, however i'm wondering if it's possible to match multiple columns (i.e A:P) rather than just 1 column?

I tried altering the codes: ("A" & Rows.Count).End(xlUp)) to contain "A:P" but it didn't work - Run-Time error 4004 Method of 'Range' of '_Worksheet' failed.

Basically I have customers with multiple purchase orders, and within each purchase order is multiple products, so i'm unable to just change "A" to another column for reference.
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
As this is a totally different question, you need to start a thread of your own. Thanks
 
Upvote 0

Forum statistics

Threads
1,215,218
Messages
6,123,676
Members
449,116
Latest member
HypnoFant

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top