+ Reply to Thread
Results 1 to 16 of 16

Need help concatenating fields from different workbooks

Hybrid View

  1. #1
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Post Need help concatenating fields from different workbooks

    Hi there ...
    I am trying to take one particular cell from a certain workbook spreadsheet and concatenate the contents to the same cell number in a different workbook spreadsheet.
    In order to make sure it is the correct record that I am concatenating to, I need to create a key made up of two seperate cells (firstname + lastname) and match the
    record on both workbooks before I concatenate. Please help.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Need help concatenating fields from different workbooks

    Can you supply some example data?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need help concatenating fields from different workbooks

    Hi..Thanks so much for responding...

    Here's an example:
    Workbook1 : Final
    Column A : Dept #
    Column B : Employee Name
    Column C : Job Description

    Workbook2 : Staff
    Column A : Dept #
    Column B : Employee Name
    Column C : Job Description

    So both workbooks are identical as far as columns are concerned. What I want to do is that every time Column C in "Staff" gets updated, I want to update Column C in "Final" as well. BUT column C in "Final" may already have data, so I want to add the new Column C data from "Staff" to the end of the existing Column C data in "Final". I want to make sure I have the correct record before updating so therefore I want to create a unique field using Dept # and Employee Name
    And the data is in separate multiple workbooks not separate worksheets in one workbook.

    I appreciate your help!

  4. #4
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need help concatenating fields from different workbooks

    Can anyone help me with this problem? I don't even know if it's possible to extract data from separate workbooks?? I know worksheets within one workbook is doable...but in my problem I have different workbooks that I need to extract data from...please help!!!

  5. #5
    Forum Contributor ianh's Avatar
    Join Date
    11-19-2010
    Location
    Newcastle
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: Need help concatenating fields from different workbooks

    you can add reference's in the following format =[Book2]Sheet1!$A$1
    where[Book2] would be your file name sheet1! would be the tab name (always with the ! at the end) then the cell.
    You should be able to use this style of reference for concatenations or lookups (lookups change the cell reference to a range).

    If you dont have all the work books open you may need to use ='\\theta\ihudson$\[Book1.xlsx]Sheet1'!$A$2. the expanded fist part \\theta\ihudson$ being a file location ie c:\documents\
    2+2=5 for extremely large values of 2.

  6. #6
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need help concatenating fields from different workbooks

    Anybody have any ideas on how to right the code??

  7. #7
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need help concatenating fields from different workbooks

    I really need help with writing the code, so if anyone can assist I look forward to hearing from you ... Thanks so much!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Need help concatenating fields from different workbooks

    Why dont you attach your 2 sample workbooks?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  9. #9
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need help concatenating fields from different workbooks

    Here is an example:
    Master.xls
    Employee. Tax id. Name. Comments
    AB. 1234. Jones, Edward. 8/14 some notes.
    CD. 5544. Smith, S/ABC. Some notes.

    EmployeeAB.xls
    Employee. Tax Id Name. Comments
    AB. 1234. Jones, Edward. More notes.

    EmployeeCD.xls
    Employee. Tax id. Name. Comments
    CD. 5544. Smith,S/ABC. Another note.
    CD. 5000. Smith,S/ABC. New notes


    When the macro is complete, master.xls should look like this:
    Employee. Tax Id. Name. Comments
    AB. 1234. Jones, Edward. 8/14 some notes. More notes.
    CD. 5544. Smith,S/ABC. Some notes. Another note.

    The 2nd record in EmployeeCD is ignored because the tax id and name did not match.

    Any help is much appreciated...

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Need help concatenating fields from different workbooks

    Quote Originally Posted by excelhelp14 View Post
    The 2nd record in EmployeeCD is ignored because the tax id and name did not match.
    What if there is a record in employeeAB which is not there in master.xls, should it be ignored as well?

  11. #11
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need help concatenating fields from different workbooks

    yes it will be ignored as well .. any records that do not have an exact match are just ignored. I am combining the tax id and name, to get a unique key.

  12. #12
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need help concatenating fields from different workbooks

    no ideas for me??

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,174

    Re: Need help concatenating fields from different workbooks

    I don't think anyone wants to create two sample workbooks in order to develop and test formulae and/or code for you.

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook. Don't upload a picture when you have a workbook question. None of us is inclined to recreate your data. Upload the workbook and manually add an 'after' situation so that we can see what you expect. In addition clearly explain how you get the results..
    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.

    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.

    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.

    To upload a file from your computer, click the 'Browse' button and locate the file.

    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  14. #14
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need help concatenating fields from different workbooks

    Thanks so much for the etiquette tips...I have never used this site before, so I appreciate it. I couldn't figure out how to attach the attachments, thats why I added it onto the thread. I still can't
    find the manage attachments that you are talking about...

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,174

    Re: Need help concatenating fields from different workbooks

    If you click on "Go Advanced", the Attachments icon looks a bit like a paperclip on the top row of icon (between the smileys and the Undo icons.


    Regards, TMS

  16. #16
    Registered User
    Join Date
    01-11-2012
    Location
    Mountain House, CA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need help concatenating fields from different workbooks

    Ok, I added attachments of the three files I am working with.

    The final outcome for Master should be:
    Employee Tax ID Name Comments
    AB 1234 Jones, Edward 8/14 some notes. More notes.
    CD 5544 Smith, S/ABC Some notes. Another note.

    Thanks so much!
    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)

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