+ Reply to Thread
Results 1 to 7 of 7

Getting data from one workbook to another

  1. #1
    Registered User
    Join Date
    07-05-2022
    Location
    Denmark
    MS-Off Ver
    MS 365 for enterprise
    Posts
    4

    Question Getting data from one workbook to another

    Hello!

    I am working at a firm and we are currently getting help from some external consultants. In this connection, of course, we have to pay for the help. However, there is a lot of consultants and the payment for each consultant depends on their level of experience. Once a month we get an Excel-file with the registered working hours for each consultant. In that connection we have made our own Excel-file where we are keeping track of the working hours so we can check the invoices they send us. At this point we are typing in the hours manually, however, we would like to automate this process. My question to you is:

    How do we get the data from the file the consulting firm are sending us to our own file?

    The names of the individual consultants appears in both files. I was thinking that maybe there would be a possibility that we could make a search for matching names in the two files and from this register their workload

    How do I do this in VBA?

    Thank you for helping on advance

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Getting data from one workbook to another

    It would be easier to help and test possible solutions if you could attach copies of your two files. Explain in detail what you want to do referring to specific
    cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary). See the yellow banner at the top of this page for instructions to attach a file.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    07-05-2022
    Location
    Denmark
    MS-Off Ver
    MS 365 for enterprise
    Posts
    4

    Re: Getting data from one workbook to another

    I would love to post the files here. However, legaly I can't due to generel data protection regulations and because of duty of confidentiality in the two companies...

    Is there any kind of generel commands that might be useful in this case?

    Thanks in advance

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Getting data from one workbook to another

    Could you replace any sensitive data with generic data? A dozen or so rows would be enough.

  5. #5
    Registered User
    Join Date
    07-05-2022
    Location
    Denmark
    MS-Off Ver
    MS 365 for enterprise
    Posts
    4

    Re: Getting data from one workbook to another

    Hi again

    I am sorry about the late reply, but I've been on vacation for a little month or so...

    I've made 3 files with random generated names and made up company names to illustrate how it works. The program members file is the one that we have made ourselves where we are tracking the working hours for the individual consultant. The hour registration files are the files that we get from the consulting company each week... I've made a file for week 1 and 4. I've already put in the hours for week 1 to show how we wish to organize it. I have made a dummy-file for week 4 in order to have a test week and to see if any givin code is working or not. One of the difficulties is that the order of the employees is random from week to week, moreover, the number of activities that the individual consultant have varies from week to week.If an employee only have been working with one activity the amount of hours they've worked will appear in the same row as their name in either column G or H depending on if it is a cunsultant from the consulting firm itself or if it is from a third party. If the employees have worked with two or more activities during the week the amount of working hours will appear next to the cell with the activity. The total amount of working hours for the individual consultant will appear in the same line as RESULT in column E. When RESULT appears in any other column than E it the accumulated hours for the teams. We wish to have the total amount of working hours automatically registrered in the program members file.
    If the working hours in one of the weeks are left blank in the program members file, it means that they have not registrered any hours for that week, and their name will in that case not appear in the hour registration files.

    Do you guys have any suggestions to how this can be done?

    Thank you for helping on advance

  6. #6
    Registered User
    Join Date
    07-05-2022
    Location
    Denmark
    MS-Off Ver
    MS 365 for enterprise
    Posts
    4

    Re: Getting data from one workbook to another

    The files should be attached now

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Getting data from one workbook to another

    Place this macro in a regular module in your Program Members workbook and run it from there. Before you run the macro make sure that the only other workbook that is open is the desired Hour Registration workbook. Only those two files must be open when the macro is run. The only way I could get this to work was to have the macro modify the Hour Registration workbook by inserting the employee names in the blank cells in column E where there was a time in column H or column G. Hopefully, that's OK with you. Just make sure that when you run the macro, the original, unchanged Hour Registration workbook is open.
    Please Login or Register  to view this content.

+ 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. Replies: 0
    Last Post: 08-05-2019, 04:33 PM
  2. Replies: 0
    Last Post: 05-05-2014, 11:06 AM
  3. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  4. Replies: 6
    Last Post: 01-29-2013, 07:01 AM
  5. Copy data from workbook, create new workbook, paste data to new worbook?
    By mpkavanagh in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-16-2011, 06:39 PM
  6. 1.Open workbook. 2 copy data. 3 replace data. 4 save workbook.
    By Cristobalitotom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2006, 07:24 PM
  7. Replies: 1
    Last Post: 04-01-2006, 03:50 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