+ Reply to Thread
Results 1 to 5 of 5

VBA Script to query all matching in range

  1. #1
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Davenport, Iowa
    MS-Off Ver
    Excel 365
    Posts
    206

    VBA Script to query all matching in range

    Hi,

    I have an data table where a list of Core Products, tied to a ProductID and the quantity. I would like the ability to paste into column A a list of unique ProductID's and with a VBA script pull the matching results onto the same sheet displaying the ProductID, Quantity, and CoreProducts. One trouble I am having is the DataTable has close to 200,000 rows. If anyone has any ideas how I can make this work quickly and efficiently it would be greatly appreciated. Attached is a copy of an example.
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Script to query all matching in range

    Where does the 'Other Data' come from?

    This code will get the QuantityPer and CoreProduct data for all the ProductIDs pasted into column A on InputSheet but it won't put the result in the columns indicated on InputSheet (after).
    Please Login or Register  to view this content.
    Last edited by Norie; 10-01-2019 at 09:07 PM.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Davenport, Iowa
    MS-Off Ver
    Excel 365
    Posts
    206

    Re: VBA Script to query all matching in range

    Its pulled from other data sources - Ideally I would like this script to run first to get the product ID's then use multiple Vlookups to reference other data

  4. #4
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Davenport, Iowa
    MS-Off Ver
    Excel 365
    Posts
    206

    Re: VBA Script to query all matching in range

    I pasted this into the VBA portion of the sheet, but it is not running after the list is updated - can this be written to run in a regular module?

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: VBA Script to query all matching in range

    Try
    Please Login or Register  to view this content.

+ 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. [SOLVED] Alter Matching Sub From matching two Ranges to matching one range and list
    By capson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2015, 10:48 PM
  2. Excel script to log into Web page for my Web query
    By vitt4300 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-20-2015, 02:12 PM
  3. SQL Query to get count of matching & non-matching data from two tables
    By Kiran2012 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2013, 10:32 PM
  4. [SOLVED] Issue with matching fields script
    By agarcia0742 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2012, 10:32 AM
  5. Problem with Query / Script
    By Fionnan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2011, 04:00 AM
  6. Script Dictionary Not Matching
    By Xrull in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2011, 12:07 PM

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