+ Reply to Thread
Results 1 to 4 of 4

Index match to VBA copy the found entire row

  1. #1
    Registered User
    Join Date
    10-15-2009
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    5

    Index match to VBA copy the found entire row

    Hello,

    I'm having troubles with getting the index match function into vba.
    And when the row is found get it to be copied to de worksheet.

    the formula i want to get into vba is:

    PHP Code: 
    =INDEX(Database!D$2:D$2000;MATCH($A2&" "&$C2&" "&$G2;Database!$A$2:$A$2000&" "&Database!$C$2:$C$2000&" "&Database!$G$2:$G$2000;0)) 
    It compares three different cells which have to match.
    this will give me the row i want to copy to the sheet.

    Does somebody have an idea to get this done.

    many thanks bram

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Index match to VBA copy the found entire row

    Hi,

    If your question is how do you get VBA to add the function, then you need to modify it as follows

    Please Login or Register  to view this content.
    i.e. where you have literals such as a space " ", you need to include the literal in its own pair of quotes, e.g. " " becomes "" ""

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Index match to VBA copy the found entire row

    When adding formulae via VBA use , delimiter rather than ; regardless of client locale
    (native XL will translate... though I'm not sure this holds for ATP functions (not used here)).
    Last edited by DonkeyOte; 10-19-2009 at 11:40 AM. Reason: added note: re ATP

  4. #4
    Registered User
    Join Date
    10-15-2009
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Index match to VBA copy the found entire row

    I made an example of the sheet i have now to give a better view of what i want to achieve.

    I have a userform for putting data into the database.
    But most of the entry will be the same only the revision will change.
    So I made a check for most of the values that they will fill in automaticly.

    If you enter de class item en sheet number of an entry which is already in the database the rest is filled in.

    It put the values of class item en sheet in sheet "index match" where i have the other cells filled with the index match formulas to get al the information.
    But if i can find the row en copy that row whitch matches one formula of index match it would be much faster I think.

    In the example it is al lot faster then in my real worksheet so i was wondering if this proces could be speeden up a bit by losing a lot index match formulas which have to search the hole database.

    I hope this will give a better view of what I want to achieve.

    Thanks Bram
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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