+ Reply to Thread
Results 1 to 5 of 5

Translate Index/Match function with multiple variables into VBA code

  1. #1
    Registered User
    Join Date
    06-26-2018
    Location
    Arizona
    MS-Off Ver
    Windows 10 Pro
    Posts
    2

    Translate Index/Match function with multiple variables into VBA code

    Good Day,

    I am having trouble translating the below Excel code into VBA:

    INDEX('2018 Data'!F3:F14728,MATCH(1,('2018 Data'!A3:A14728=Code2)*('2018 Data'!B3:B14728="TC"),0)

    The above code searches for a specific code in one cell WITH a specific modifier attached in another cell.
    Example: 92083 TC (92083 being in one cell and the TC in another)

    What I thought could work:


    Price1 = Application.WorksheetFunction.Index(Sheets("2018 Data").Range("F3:F14728"), Application.WorksheetFunction.Match(1, Sheets("2018 Data").Range("A3:A14728" = Code1)), Application.WorksheetFunction.Index(Sheets("2018 Data").Range("F3:F14728"), Application.WorksheetFunction.Match(1, Sheets("2018 Data").Range("B3:B14728" = "TC"), 0)))

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Translate Index/Match function with multiple variables into VBA code

    You are over complicating this.

    Use the find function to find your search String.

    Please Login or Register  to view this content.

    I am too tired to work out what you are trying to achieve so please attach a sample.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Last edited by mehmetcik; 06-26-2018 at 04:59 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Translate Index/Match function with multiple variables into VBA code

    Why do you feel the need to use VBA for this? A formula may be quicker.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    06-26-2018
    Location
    Arizona
    MS-Off Ver
    Windows 10 Pro
    Posts
    2

    Re: Translate Index/Match function with multiple variables into VBA code

    Thanks for the advice!

    You both are right, I am overthinking it. I just decided to have my vba code reference the formula I already have working.

    Cheers!

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Translate Index/Match function with multiple variables into VBA code

    Perhaps you missed my question?

+ 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. How to use dynamic variables in an Index & Match function?
    By hussco in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-01-2017, 03:36 AM
  2. How can i translate an Index/Match formula into VBA code?
    By hzarry in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-06-2015, 12:42 PM
  3. index / match multiple variables
    By zaqS in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-05-2015, 04:28 AM
  4. Translating Index/Match Function with Multiple Variables into VBA
    By slamdunka in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2015, 05:59 PM
  5. [SOLVED] INDEX/MATCH Multiple Worsheets Multiple Variables
    By Jadvancing in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2013, 06:42 PM
  6. [SOLVED] Index Match function for multiple linked variables
    By Bob in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-22-2005, 09:00 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