Macro to allocate objects from a column on Excel to an existing data base on SQL, please help!

naviero1

New Member
Joined
Jul 21, 2014
Messages
14
Good afternoon everyone,
I'm having a bit of a challenge and rather difficulty in finding out a reliable code in order to perform these:
First of all, Let me describe the data in Use:
-There is an existing data base on SQL that is constantly updated from a different source from excel and that serves as a depository of past transactions; the data base consists of 6 columns: SQLdata( DATE, UPC, Type, Plant, Acases, Scases).
-There is also an extraction table on Excel that can be refreshed at anytime and will replicate the SQLdata with its respective columns on Excel.
-I have added a column, outside that "refreshable table" with the name: Reasons, which can be summarized by a 2 digit code. The reasons are manually input by the person in charge of this sheet.

+ I am trying to find a way in which that new column "reasons" can be updated and allocated to its respective string in the SQLdata base. I would probably need to first create a new column (without objects) on SQL, I am guessing.

So the algorithm would be something like this:

1) Read new data that has been input on excel datable
2) Find/match -DATE,UPC and plant in SQLdata base
3) Create new column once or add a new column where this reason codes can be allocated
4)Allocate respective "reason" object (R1,R2,R3) matching the values on excel (that correspond to its reason code) with the values (DATE, UPC and plant) on the SQL file.
5) Save SQL data base with new values
6) Finish

I appreciate your input in advance
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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