• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

SQL in VBA

Sathish KV

Active Member
Hi All,

Thought of sharing something new!

What if you have a database in separate excel file and the data to be queried in separate excel file and output required in a separate excel file

Check out the attached file. The sql connection string mackes an ADODB connection to both data base and the 'To be queried' file then the result in brought to our current workbook

Just save all the three excels to from zip file to same folder.
Open the 'SQL in Excel VBA.xlsm' file and click the command button
You can also increase or decrease the data in 'Query Upload File.xlsx' to check the it works perfectly

Any queries welcome!
 

Attachments

Top