+ Reply to Thread
Results 1 to 8 of 8

Issue using array to find values across multiple worksheets

  1. #1
    Registered User
    Join Date
    08-03-2018
    Location
    Texas
    MS-Off Ver
    Office 365
    Posts
    4

    Issue using array to find values across multiple worksheets

    I am trying to create a sheet that will allow me to find items within a date range across multiple worksheets. I have been working with a formula that I found online, so if there is a better formula, please tell me.

    First, I'm having trouble entering a date range; I can only lookup after a certain date (d1).

    Secondly, I can look at values on one sheet by entering the sheet name, but once I try to add the named list "Events" (which is a listing of the names of the worksheets) using the same formula I can't get any values.

    Ideally, I would like to get a list of items that must be completed within a date range and have them all show up on one page instead of looking through 50+ worksheets.

    In the attached example, I have 3 events. On the "Sheet Test" page, that is where I was able to look across one sheet to find items that need to be completed. The Sheet "Lookup Test" has the named list "Events" where I would like the names of the worksheets that will be involved in the search.

    Any help will be appreciated.
    Attached Files Attached Files

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

    Re: Issue using array to find values across multiple worksheets

    Create a new worksheet and call it Update

    Right Click on the Sheet Name "Update" at the bottom of excel and select view Code

    Paste this code in the module that opens and close it.



    Please Login or Register  to view this content.


    Place this module in to a normal Macro Module.

    Then Select the tab. "Update"

    Please Login or Register  to view this content.
    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
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Issue using array to find values across multiple worksheets

    Sample Attached
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    08-03-2018
    Location
    Texas
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Issue using array to find values across multiple worksheets

    mehmetcik,

    Thank you for your work on this for me. It looks really good and really, I am very thankful. I have been working on this for a couple of days now and no one around me has been able to help. I'm trying to read through the scripting, but I am new to VBA and I am having some trouble. I do have a couple of questions about the way it operates and a few questions about how it could sort.
    • One the event pages, there were formulas that determined what the dates would be. Once the "Update" sheet was pressed, it seems to remove those formulas. Is there a way to keep those formulas intact? It would populate the next date with the previous paperwork was completed.
    • Also, on the "Lookup Test" sheet, is there a way to set the formatting of the column width so you don't have to expand the columns every time? Can the events be listed by their date relevant to today's date? For example, if Event1 is after Event2, can Event2 be listed first in the list?
    • I tried adding a worksheet and it wan't added to the list of events in "Lookup Test"

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

    Re: Issue using array to find values across multiple worksheets

    First

    Why do you have negative values in Column F?


    Q1: One the event pages, there were formulas that determined what the dates would be. Once the "Update" sheet was pressed, it seems to remove those formulas. Is there a way to keep those formulas intact?

    if the dates are in order then we can remove the Sort Function and also the copy paste value.

    Please Login or Register  to view this content.

    Q2: Also, on the "Lookup Test" sheet, is there a way to set the formatting of the column width so you don't have to expand the columns every time?

    That is easily done.

    add this code to the end of the Macro.

    Please Login or Register  to view this content.


    Q3: Can the events be listed by their date relevant to today's date? For example, if Event1 is after Event2, can Event2 be listed first in the list?

    Do you mean sort by Cell C2 on the Event Sheets?

    I would Write the Sheet Names and Dates into Excel and Sort them
    I would then read that list into an array
    Finally I would read the sheet name sequentially from that array

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Q3: I tried adding a worksheet and it wan't added to the list of events in "Lookup Test"

    That should have been picked up automatically




    So this is the final code

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 08-09-2018 at 08:43 PM.

  6. #6
    Registered User
    Join Date
    08-03-2018
    Location
    Texas
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Issue using array to find values across multiple worksheets

    mehmetcik,

    Thank you for your work on this. I am trying to condense a few things since it appears that I don;t need a few columns and I was trying to drop the start of the information on "Lookup Test" a few rows to "A5" instead of "A3". It is necessary to have
    PHP Code: 
    Range("A3").FormulaR1C1 "'name=Events" 
    ? I was just trying to show you that I had a named list called "Events" I am attaching how I would like the ending form to look with some of the edits that I think are still returning the correct results.

    It appears in that if I change the start date from 7/23/2018 to 7/1/2018, it appears that there are no results. Any idea why that is? Am i doing something wrong?

    To answer the question about negative numbers, that task will take place after the event. The formulas at the top are setting dates before the event and the negative numbers are setting dates after the event.

    Thank you so much for your help with this. It is really helping me out!
    Attached Files Attached Files

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

    Re: Issue using array to find values across multiple worksheets

    My Mistake

    I had to amend this area of code

    Please Login or Register  to view this content.
    The revised code is:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-03-2018
    Location
    Texas
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Issue using array to find values across multiple worksheets

    mehmetcik,

    I am still not getting all of the items when I search from 7/1/2018 to 8/16/2018. I am not sure what is happening.

+ 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] find copy paste and delete multiple values between worksheets depending on value in column
    By LeggRyan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2017, 10:51 PM
  2. Find a value from array in another table with multiple values
    By ASAFSWIS in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-25-2013, 09:19 AM
  3. find values across multiple worksheets
    By annazet in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-19-2013, 09:15 AM
  4. Find, add and return values from multiple worksheets
    By Excelmad101 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-27-2013, 04:53 PM
  5. find and replace multiple values across multiple worksheets
    By Blake 7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2012, 10:48 AM
  6. Find a value in an array and return multiple values in an adjacent array
    By tonbra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2012, 08:35 PM
  7. VLOOKUP Find values from multiple worksheets
    By Strugggler in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-23-2009, 01:44 AM

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