Use VBA to generate SQL reports

Stephanie30

New Member
Joined
May 21, 2015
Messages
13
Hi

I need help in writing a vba code which would connect to SQL and run a SQL statement to generate a report based on company name. The code should then save the output to the defined location in the excel data table

The data table in excel has company names from b2:b50. Column C is a user field where a user will mention as YES if they need the report for that company.

The user will also mention in column D whether which location they would want to save the report output

Once when the above is updated, the user will trigger the macro and the code should connect to SQL database and extract Reports based on the company name mentioned in column B
 
Last edited:

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
442
There is absolutely nothing to go on there! Perhaps you could start with the database connection... What is it called? Where is it located? What is the name of the Table the records are on? Which records do you want to import? Import all fields from each record or just a couple? etc etc
 

Forum statistics

Threads
1,085,545
Messages
5,384,367
Members
401,889
Latest member
Pmccollin

Some videos you may like

This Week's Hot Topics

Top