+ Reply to Thread
Results 1 to 4 of 4

Run a macro that would return a dataset from SQL into Excel

  1. #1
    Registered User
    Join Date
    08-08-2012
    Location
    Malta
    MS-Off Ver
    Excel 2007
    Posts
    2

    Run a macro that would return a dataset from SQL into Excel

    Hi all,

    I am trying to figure out if there is a way to create a macro that would run a SQL statment on a database and that would return the result into Excel.The macro should have a nice dialog box where users enter the date parameter (dynamic parameter) and press ok to excute the macro.I am new to macros and VB and any help or suggestion would be greatly appreciated.Thanks a lot!

    Blair

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Run a macro that would return a dataset from SQL into Excel

    You wouldn't need to create a macro for only one parameter, have a look here -
    http://superuser.com/questions/19745...rom-excel-2007

  3. #3
    Registered User
    Join Date
    08-08-2012
    Location
    Malta
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Run a macro that would return a dataset from SQL into Excel

    Yes I know about this option,I actually use it myself. But the solution I am after is based on the assumption that the worksheet will be used by end users that have very little experience in Excel.That is why i want to automate the whole process as much as possible so that the user will only have to enter the date and push a button to get the desired results.Thanks for your suggestion anyway,I should have explained myself better

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Run a macro that would return a dataset from SQL into Excel

    Once it is set up, all the user needs to do is change the date in a given cell (it will then return the results) - I'm not sure you can really make it any easier?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1