+ Reply to Thread
Results 1 to 5 of 5

Index Match VBA Multiple Worksheets Many Rows

  1. #1
    Registered User
    Join Date
    07-31-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Index Match VBA Multiple Worksheets Many Rows

    Hi All,

    I have a workbook that has 5 worksheets. Worksheet1 is the Summary tab, Worksheets 2-5 contains data all sitting under the same headings and formats however vary in row number e.g.

    Worksheet 2 - 63000 rows
    Worksheet 3 - 48000 rows
    Worksheet 4 - 23000 rows
    Worksheet 5 - 21000 rows

    In Worksheet 1 Column AQ contains a Cost Centre number which I would like to extract the parent description of in Column BI of the same Worksheet and then the child description into Column BJ. Worksheet 1 currently has 16000+ rows and grows daily.

    The location of the Cost Centre in Worksheets 2-4 is contained in Column A and the Parent Description in Column W and the Child Description in Column Y.

    I am currently using this INDEX MATCH formula to search all worksheets but as you can imagine it's tediously slow and needless to say sometimes not reporting/updating the values correctly likely because it's frozen.

    =VLOOKUP(AQ2,INDIRECT("'"&INDEX(Sheet1!$A$1:$A$4,MATCH(TRUE,
    COUNTIF(INDIRECT("'"&Sheet1!$A$1:$A$4&"'!A2:A63355"),AQ2)>0,0))&"'!A2:W63355"),23,0) this looks up Cost Centre in Worksheet 1 Column AQ and returns the results from Column W in Worksheets 2-4 to Worksheet 1 Column BI

    =VLOOKUP(AQ2,INDIRECT("'"&INDEX(Sheet1!$A$1:$A$4,MATCH(TRUE,
    COUNTIF(INDIRECT("'"&Sheet1!$A$1:$A$4&"'!A2:A63355"),AQ2)>0,0))&"'!A2:Y63355"),25) this looks up Cost Centre in Worksheet 1 Column AQ and returns the results from Column Y in Worksheets 2-4 to Worksheet 1 Column BJ


    Sheet1!$A$1:$A$4 simply contains a lookup table containing Worksheets 2-4 names.

    Can anyone help in either optimising this formula or would a VBA solution be more efficient. If VBA is the way forward then could I ask that it be written so that should I need to add a column to report back on then it is easy enough to do so simply by inputting the column identifier within the array.

    I have Excel 2007.

    Looking forward to all responses.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Index Match VBA Multiple Worksheets Many Rows

    Here's a small UDF which should help:

    Please Login or Register  to view this content.
    Use as:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This will look for the specified value in all worksheets other than the sheet where the function is placed. Specify the LookIn and Return columns, to determine where to find the value, and which value to return.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-31-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Index Match VBA Multiple Worksheets Many Rows

    Works a charm

    Any chance it can written so that it does not knock the column formatting out i.e. Remove the Cell borders and shading?

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Index Match VBA Multiple Worksheets Many Rows

    Won't affect formatting at all.

  5. #5
    Registered User
    Join Date
    07-31-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Index Match VBA Multiple Worksheets Many Rows

    Ok think it was my error.

    Thank you so much for your help

+ 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. Index & match SUM multiple worksheets
    By Thito in forum Excel General
    Replies: 12
    Last Post: 04-02-2014, 05:15 PM
  2. Index and Match across multiple worksheets
    By GTHORE in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-09-2013, 01:05 PM
  3. Index match multiple worksheets
    By rrivera616 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-28-2013, 07:03 PM
  4. index and match across multiple worksheets
    By pertenax in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-21-2012, 03:15 AM
  5. Excel 2007 : Index and Match using multiple worksheets
    By lola12345 in forum Excel General
    Replies: 1
    Last Post: 10-27-2011, 03:31 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