+ Reply to Thread
Results 1 to 9 of 9

Macro to extract data from other work book & add hyperlink

  1. #1
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Macro to extract data from other work book & add hyperlink

    Hi

    This I think this may be very tricky and not even sure it is possible, its way over my head.

    I have 2 workbooks, one called “warehouse wastage” which sits in a folder on its own and in a sub directory I have one called “160712” this file will be in folder / JE / ALLOCATIONS

    The 160712 is just the date the information was saved.

    What I am trying to do it this, on the 160712 file I have a list of names in the U column, and these names will match the names on the warehouse wastage B6:F6.

    On the warehouse wastage book N column I have a list of dates, if you look at N30 the date is 16/07/12 which is the same as the 160712 file apart from the / The dates in this column will be added when a file with the same date is added to the appropriate folder

    If you look at E30 there is some data under the name Ross, this data comes from all the entries in the T column of the 160712 files that are against Ross’s name. The same will apply to the other names.

    At the moment I have to open this file then add up all the entries under each persons name then add the data to the warehouse wastage file. Would it be possible for this to be done automatically with a macro when a file is dropped into / JE / ALLOCATIONS folder? I would prefer not to use a formula if I don’t need to.

    One last thing if possible when the data is added I would like it to auto make a Hyperlink so when the data is clicked it will open up the date file.

    I hope I have explained this clearly, and please feel free to tell me where to go if this is to much to do

    Many Thanks
    Attached Files Attached Files
    Last edited by SilverFox; 07-24-2012 at 07:24 AM.

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Macro to extract data from other work book & add hyperlink

    See attached file where I added Macro1.
    Macro will get all files from subdir (je\allocations). In other words, if you store warehouse wastage file in 'c:\mypath\' macro will get files in 'c:\mypath\je\allocations\".
    This is the macro I used (if you can't download file):
    Please Login or Register  to view this content.
    I hope it's what you want.

    Regards,
    Antonio
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro to extract data from other work book & add hyperlink

    Hi Antonio

    Thanks very mich for the help on this, i have tested the code and it is nearly there. The only thing that needs changed is on the Allocations tab in the "N" column the dates will already be there, i need it to look down the N column when it finds the date with no data then look for that date file in / JE / ALLOCATIONS then insert the data in that row, At the moment your code is adding the date to the N column. would it be possible to change this?
    Last edited by SilverFox; 07-20-2012 at 05:27 AM.

  4. #4
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro to extract data from other work book & add hyperlink

    Basically all i need now is for the code to look at warehouse wastage book "N" column, and go down to the last date entry, then match that date up with the files in / JE / ALLOCATIONS, if it find a match, extract the data and add it in to the right row next to the date in the N column on the warehouse wastage sheet.

  5. #5
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro to extract data from other work book & add hyperlink

    Can any one please help me out with this?

  6. #6
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Macro to extract data from other work book & add hyperlink

    I changed the macro as you asked.

    This is new macro:
    Please Login or Register  to view this content.
    Regards,
    Antonio
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro to extract data from other work book & add hyperlink

    Antonio my friend you are a genius, that worked perfectly, thanks so much.

    Could i ask you to do one last thing?

    Would it be possible to add something to the macro? on the right side of my work sheet i have the same names from H6:L6 only this data will be coming from / GE / ALLOCATIONS

    At the moment we have

    B6:F6 coming from / JE / ALLOCATIONS

    can we add

    H6:L6 coming from / GE / ALLOCATIONS

    Many Thanks

  8. #8
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Macro to extract data from other work book & add hyperlink

    I changed the macro as you asked.
    Now macro get first subPath from first two chars onm the left of ranges B4 and H4.
    This is new macro:
    Please Login or Register  to view this content.
    Regards,
    Antonio
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro to extract data from other work book & add hyperlink

    Antonio that is fantastic, thank you very much for all the hard work, Problem Solved yet again

+ 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