+ Reply to Thread
Results 1 to 3 of 3

Using Where Clause in VBA to extract from Access to excel without access

  1. #1
    Registered User
    Join Date
    06-23-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    1

    Using Where Clause in VBA to extract from Access to excel without access

    Hello,

    I am using the below query to extract information from an MDB file. The issue is that it extracts everything on the file.

    I need only if it is equal to a particular value eg. TPX column = cell value on the excel sheet to extract on my excel sheet
    And I need only if it is equal to a particular value eg. Time column = cell value on the excel sheet to extract on my excel sheet

    Thanks in advance

    Please Login or Register  to view this content.
    Last edited by Cutter; 08-19-2012 at 08:33 PM. Reason: Added code tags

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Using Where Clause in VBA to extract from Access to excel without access

    The easiest thing you can do is create the query in your database and copy the sql from the query and add it to your code.
    Then you can do something like this below, Makes it alot faster then looping thru the recordset

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Using Where Clause in VBA to extract from Access to excel without access

    @ ish1979

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

+ 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