+ Reply to Thread
Results 1 to 5 of 5

Index/Match formula into VBA code

  1. #1
    Registered User
    Join Date
    06-26-2014
    Location
    Scotland
    MS-Off Ver
    10
    Posts
    37

    Question Index/Match formula into VBA code

    Hi I currently use the following formula;
    =IFERROR(INDEX(Table5,MATCH(1,(Table5[Date]=$D$288)*(Table5[Pay No.]=G2),0),13),0)

    Which checks a table on a different page for the matching day and employee's pay number and pastes their start time into the cell

    This seems to work but I have to translate it into vba code as I would like to add more to it
    I think this would work best as a function so I could change the dates and pay no.

    Can anyone help ?
    I am a still quite new to VBA

  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: Index/Match formula into VBA code

    Formulas can't paste into cells.

    How/where exactly are you using that formula?

    Also, what more do you want to add?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    06-26-2014
    Location
    Scotland
    MS-Off Ver
    10
    Posts
    37

    Re: Index/Match formula into VBA code

    The formula is in the cell which I want to show the employees start time

    I currently have a tab of all employees start/finish times ect. which is updated daily and I want to paste the start times into a separate master tab to save time manually entering the times every day

    I use the formula (ABOVE) to paste the start times but if the times are marked red I also want this to show on the master tab.

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

    Re: Index/Match formula into VBA code

    So what do you actually want to do in code?

    If all you wanted to do was to get the result of the formula you could use Evaluate.
    Please Login or Register  to view this content.
    You could then put the result into a cell on the master sheet.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-26-2014
    Location
    Scotland
    MS-Off Ver
    10
    Posts
    37

    Re: Index/Match formula into VBA code

    Thank you this works, although is there a way to replace the cell references with the ranges

    So $D$288 would be RDate
    and U2 would be RPay ?

    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. Replies: 3
    Last Post: 05-02-2013, 01:31 AM
  2. comparision between two excel sheet using VBA Code for Index/match/and/iferror formula
    By gaurangaero in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2012, 10:08 AM
  3. Index & Match VBA Code
    By OcMac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2012, 12:28 PM
  4. Index Match Index Formula work slow
    By avk in forum Excel General
    Replies: 9
    Last Post: 03-07-2012, 02:19 PM
  5. Replies: 5
    Last Post: 02-29-2012, 08:51 PM

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