+ Reply to Thread
Results 1 to 2 of 2

Optimize VBA code, add more tables to download?

  1. #1
    Spammer
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    387

    Optimize VBA code, add more tables to download?

    Through google searches and help in these forums I have been able to piece together the below VBA code.

    Basically right now, it tells excel to connect to a DB table NDA, downloads the data to Sheet 1, (called Hidden), and then copies most of that code to Sheet 2 (called Tariff).

    Is there a better way to execute this function? It seems to work relatively quick now... but thought that if it were better optimized it may be faster/easier on the computer to run?

    I would like the code optimally, to access another table in the DB, and download that data as well (and then have it copied to Sheet 2). Is the only way for me to accomplish this to merge the tables within the DB? Or Can it download the data from say NDAS 2 lines below where NDA's download ends?




    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Optimize VBA code, add more tables to download?

    I opened the workbook and didn't find a database connection. However I'll offer a suggestion.

    Change this line
    Please Login or Register  to view this content.
    To
    Please Login or Register  to view this content.
    Where TableName is a defined name of a cell in the workbook. So enter in the new table name in this cell when you want to run the query from another table in the same database.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Optimize a code
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2015, 05:31 PM
  2. Optimize code
    By DarkKnightLupo in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-19-2014, 08:58 AM
  3. Creating two pivot tables on same sheet - Optimize recorded macro code
    By johnny_tc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2012, 11:59 AM
  4. optimize the Code needs to run faster
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2012, 10:40 AM
  5. Optimize code
    By miso.dca in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-08-2011, 03:35 PM
  6. Optimize Alphabetizing VBA Code
    By NewExcelUser in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2010, 11:51 PM
  7. Optimize VBA code
    By doodlebug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2007, 07:53 AM

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