change string in a cell and connect to database

newapa

Board Regular
Joined
Sep 13, 2012
Messages
69
Hi!


i need a macro that change a table in a selection and connect to database and check how many rows it get with that selection.


somthing like this.
Code:
    select                                                   employd1     eployd2       employd3


    select name from table where name = Mike                 250 row       300 row      0 row
    select lastname from table where lastname = arthur       30 row        580 row      52 row
    select street from table where street = street123        0  row        0 row        5 row

as u can se i'm trying to change table name so it get the column name insted like emplyod1,2 or 3 and connect to database and write how many rows it get from that selection.
insted of creat 3 selection and only table name needed to change.


Any help will be highly appreciated


thx in advance
 
Last edited:

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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