+ Reply to Thread
Results 1 to 5 of 5

How do I Vlookup into another workbook and search for a date in a sheet to copy 3 cells.

  1. #1
    Registered User
    Join Date
    07-15-2022
    Location
    Delta Canada
    MS-Off Ver
    365
    Posts
    73

    How do I Vlookup into another workbook and search for a date in a sheet to copy 3 cells.

    I have a source workbook that has 52 weeks of the year.(one sheet for each week, plus a couple at the beginning) Each sheet has the same table and same cells.
    Every week new data is inputted into the table. At the end of the table it totals up all three cells.
    The data is... A number, A goal, and a percentage of the number to that goal.

    Help 01.png

    Week one of 52 weeks will start on sheet#3 (third sheet from left) Week 2 will be on Sheet #4 and so on.

    The Dashboard workbook, the user will enter a date in the "fill date here" cell.
    The Vba will go to Source workbook, and find and open the sheet for that week of the date, and copy the date (3 cells example E4, E5, E6).
    It will then paste these three cell into the dashboard workbook sheet. At the same time it will also copy the Week Total at the end of the table ( 3 cells K4,K5,K6)
    It will also paste this into the dashboard workbook sheet.

    Help 02.png

    Does this make sense?
    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: How do I Vlookup into another workbook and search for a date in a sheet to copy 3 cell

    See tables in LOOKUP *"Dashboard")

    in C3

    =TRIM(TEXT($B2,"00-") &TEXT($A2,"mmmdd"))

    in D2

    Source Work Book.xlsx

    in "Fill in"

    in G2

    =INDEX(Lookup!$C$2:$C$53,MATCH($B$3,Lookup!$A$2:$A$53,1))

    Hide the above by FONT color = White

    in B5

    =INDEX(INDIRECT("'[" &Lookup!$D$2&"]" & $G$2 &"'!$E$4:$K$6"),ROWS($1:1),MATCH($B$3,INDIRECT("'[" &Lookup!$D$2&"]" & $G$2 &"'!$E$3:$K$3"),0))

    in E5

    =INDEX(INDIRECT("'[" &Lookup!$D$2&"]" & $G$2 &"'!$K$4:$K$6"),ROWS($1:1))

    Both workbooks open

    BUT having 52 sheets for 3 lines of data on each ..... and 2 workbooks: why not all in one ? See example "Source Work Book"
    Attached Files Attached Files
    Last edited by JohnTopley; 10-04-2022 at 08:28 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    07-15-2022
    Location
    Delta Canada
    MS-Off Ver
    365
    Posts
    73

    Re: How do I Vlookup into another workbook and search for a date in a sheet to copy 3 cell

    Hi John,
    Thanks so much for your help?? This works Awesome..
    I asked the same question??..( why not on one sheet? )
    This "Dashboard Workbook" will pull data from three different workbooks when we are finished.
    This "Source Workbook" is just the first one.

    In this source book, there is a lot more going on at the bottom, I stripped it down to make it easier to work on. But yah, it would be nice if it was all in one workbook.

    How on earth does your workbook reference the source workbook...?
    I imagine both workbooks need to be in the same folder What if the source file name is different?
    I guess I could have a macro to open source book when I want to run the dashboard. That's easy.

    Is it hard to open another work book then switch back to the workbook we are working on ( Dashboard ), so that source is open and ready?

    Thanks so much.

    Chris

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: How do I Vlookup into another workbook and search for a date in a sheet to copy 3 cell

    Cell D2 in "Lookup" contains the source book name so you can change it at will.

    You can open any workbook as required and reference it as above.

    Or use VBA.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: How do I Vlookup into another workbook and search for a date in a sheet to copy 3 cell

    VBA, if you like
    Assuming both workbooks are in the same folder.
    Run when you change the date in B3.
    1) To FIll In sheet code module
    Please Login or Register  to view this content.
    2) To a standard code module
    Please Login or Register  to view this content.
    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)

Similar Threads

  1. [SOLVED] Create button to search for date and copy row to a Dashboard sheet
    By rweathers in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-03-2018, 12:26 PM
  2. VBA to copy specific cells from a workbook to a blank sheet in another workbook
    By ka3pmw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-01-2018, 08:20 AM
  3. Replies: 0
    Last Post: 09-10-2013, 08:17 AM
  4. search code-date then copy name-date-time to another sheet
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2013, 02:25 AM
  5. [SOLVED] Search for fontcolour, copy row to another existing workbook, to sheet with cellvalue-name
    By Marloes in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-21-2012, 08:44 AM
  6. [SOLVED] Search for heading in data sheet and copy range to corresponding sheet in master workbook
    By sans in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-07-2012, 10:02 AM
  7. VBA Search workbook for user value, copy/paste entire row to last sheet for matching
    By jasonkrispy21 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2012, 03:42 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