+ Reply to Thread
Results 1 to 12 of 12

Need Macros to pull Data from one file into another - Several sheets involved

  1. #1
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Need Macros to pull Data from one file into another - Several sheets involved

    Hi again everyone!

    I have two files Daily_Stress and SampleTest. SampleTest has column J that needs to be filled in using B and E as a reference. The Macros should pull data from Daily_Stress. Column B matches with Column A in each sheet of Daily_Stress. Column E matches with one of four Sheets in Daily_Stress. R1=R1, R2=R2, and PB1=PB1. Column J of SampleTest will ultimately be filled in with the data from the correct cell in Column E from Daily_Stress.

    BUT here is the kicker and the really confusing part. I cannot have 2/2/2015 on SampleTest matching with 2/2/2015 on Daily_Stress. Instead, I need the cell connected to 2/2/2015 on SampleTest to pull in data from 2/1/2015 on the correct Daily_Stress Sheet. I am trying to list the number of tourists the day BEFORE each sample was collected.

    Does this make sense? I attached the files and the first half of column J is filled in already.

    Whatever Macros is created, I need it to please run on a Mac.

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    Do I need more clarity? This file has a bit of a time crunch so I would love to find someone to help.
    Thank you!

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    2013 / 2016
    Posts
    5,833

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    Here is my shot at it.

    In call B2 enter the path name to the source file. If you leave it blank it will assume the same path as the spreadsheet running the program.

    In cell B3 enter the file name with the data

    Click on the button.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    Quote Originally Posted by dflak View Post
    Here is my shot at it.

    In call B2 enter the path name to the source file. If you leave it blank it will assume the same path as the spreadsheet running the program.

    In cell B3 enter the file name with the data

    Click on the button.
    Thank you so much! Unfortunately, it is not reading the file path. Could this be a Mac issue? When I select Debug it highlights this part of the code:"' Check that the file exists
    If Dir(PathName & "\" & FileName) = "" Then"

  5. #5
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    Does anyone have a suggestion for how to adapt this code for a Mac? Thank you!

  6. #6
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Excel 2016
    Posts
    2,379

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    I'll take a stab in the dark here, just replaced some / with : in dflak's code.

    I have no Mac to test it on so you have to do that.
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Excel 2016
    Posts
    2,379

    Re: Need Macros to pull Data from one file into another - Several sheets involved


  8. #8
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    *sigh* They closed the thread on the Mac section.
    Thanks for trying Jacc, but your fix didn't work.

    I'm going to sit down at a Windows machine tonight and see if I can get the original code to work. Which is ok for the short term, but it really would be better to have it for a Mac.

  9. #9
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,080

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    Hi,

    Don't use "\"- use
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  10. #10
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    Quote Originally Posted by xlnitwit View Post
    Hi,

    Don't use "\"- use
    Please Login or Register  to view this content.
    !!!!!!!! This may have done it!!!!!! Let me double check a random selection of data rows first.
    THANK YOU

  11. #11
    Forum Contributor
    Join Date
    07-31-2014
    Location
    Texas
    MS-Off Ver
    Mac 2011 Version 14.5.4
    Posts
    114

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    xlnitwit - your name should be xlawesomegeniusbrain

    Thank you! You saved me weeks of error prone work with your simple edit. And I learned something new too!

  12. #12
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,080

    Re: Need Macros to pull Data from one file into another - Several sheets involved

    You're welcome, and thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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