+ Reply to Thread
Results 1 to 12 of 12

How to copy the contents from the sub files to the master worksheet based on the id?

  1. #1
    Registered User
    Join Date
    03-09-2017
    Location
    Monrovia
    MS-Off Ver
    2013
    Posts
    57

    How to copy the contents from the sub files to the master worksheet based on the id?

    Every Friday I receive about 50 excel sheets titled time utilization along with their id (eg: timeuti-1001, timeuti-1002, etc) from my classmates. Currently I am physically copy-pasting the details that they send. I would like to automate this task.
    I am saving all the files in C:\timeutilization.

    When I click on the ‘Reconcile’ command button in the mastersheet which is in the same folder. I want the macro to identify the student id from timeuti-1001 filename and for that particular student id I would like the macro to match it with the student id cell in the master sheet and copy the contents of the cell for that particular student id.

    Eg: Student with filename “timeuti-1007” sends the details this Friday.
    pic1.JPG
    I would like the mastersheet to look like this:
    pic 2.JPG

    For every student it needs to update it based on their id. If an user has not sent the details let the row remain blank. Thanks in advance.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    Hi there!
    From what date shoud the macro bring the contents?
    In the timeuti files there are multiple dates..
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Registered User
    Join Date
    03-09-2017
    Location
    Monrovia
    MS-Off Ver
    2013
    Posts
    57

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    Every Friday it needs to run.. The Mastersheet should match the date from the system time and timeuti worksheet for each user.

  4. #4
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    Hello again,

    For testing purposes I changed the date in timeuti file to match todays.


    Under your button I wrote this code:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-09-2017
    Location
    Monrovia
    MS-Off Ver
    2013
    Posts
    57

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    Thank You Very Much.. It Worked..

    I added a new column in my Mastersheet for student name. That is in Column A , and I moved Student Id to Column B.
    The individual utilization sheet remains same.

    Is this correct:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    Yes, it seems ok.
    If everything works fine please mark thread as SOLVED.
    Thank you for the rep.

  7. #7
    Registered User
    Join Date
    03-09-2017
    Location
    Monrovia
    MS-Off Ver
    2013
    Posts
    57

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    I had some problems when I had my friends send me their timeuti files. Mostly they used to change the dates. It also lead to some problems when using the system dates.
    Currently I am using a combobox infront of my Reconcile button. Is it possible for me to take the date from combobox and match it with timeuti file rather than the system date?

    testnew.JPG
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-09-2017
    Location
    Monrovia
    MS-Off Ver
    2013
    Posts
    57

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    I tried changing the Date keyword to ComboBox, but it doesn't seem to work.

    Please Login or Register  to view this content.

  9. #9
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    Actually you can use the value in the combobox like this:
    Please Login or Register  to view this content.
    but I don't think that is the problem. Using it like this will not identify it as a date but only as a string. You can give it a try, although I suggest changing the way you choose "friday".

  10. #10
    Registered User
    Join Date
    03-09-2017
    Location
    Monrovia
    MS-Off Ver
    2013
    Posts
    57

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    What do you suggest I use "Friday" as? Should I be changing the format?

    I added the changes you suggested. I got an error "run-time error:91 Object Variable or With block Variable not set"

  11. #11
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    Try this way.
    I've added a spin button that increments or decrements the date in A1 by a week!
    Also a button that brings you the current friday.
    Also a check to verify if the date in A1 is fryday.
    Take a look pls.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    03-09-2017
    Location
    Monrovia
    MS-Off Ver
    2013
    Posts
    57

    Re: How to copy the contents from the sub files to the master worksheet based on the id?

    Thanks. This works..
    You are the best..

+ 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] Copy rows to master sheet based on contents in column
    By gjw1971 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-08-2017, 06:15 PM
  2. Macro to auto copy entire row from master to worksheet based on column values
    By danielleferry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2014, 11:22 AM
  3. Copy a row from master sheet and paste it to a specific worksheet based on tab name
    By obrie499 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2013, 10:45 AM
  4. need to copy some cells contents to a another worksheet based on a value condition
    By Mochmoch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2013, 10:39 AM
  5. Copy data from several files to one worksheet based on file names
    By IuliaMihaela in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-11-2012, 04:34 PM
  6. Replies: 0
    Last Post: 04-06-2012, 05:07 PM
  7. Drop Down List to Copy Entire Contents of Worksheet into Master Worksheet
    By mrmartin in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-14-2011, 10:54 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