+ Reply to Thread
Results 1 to 4 of 4

VBA code to match and mark data from multiple sheets into a master sheet.

  1. #1
    Registered User
    Join Date
    12-05-2014
    Location
    Hanoi, Vietnam
    MS-Off Ver
    MAC
    Posts
    9

    VBA code to match and mark data from multiple sheets into a master sheet.

    Hi everyone,

    I'm totally new working with Excel and so my question might have an easy fix solution for you Excel masters out there

    I have this company Personnel file (Master sheet) and multiple training attendance sheets. What I would like to do is to compare data from multiple attendance sheets to data in a Master sheet using VBA.

    Here an example of my Master sheet named "Master":
    Please Login or Register  to view this content.
    Here an example of my first Training attendance sheets named "Sep24-2015@0900-1000":
    Please Login or Register  to view this content.
    Here an example of my second Training attendance sheets named "Sep24-2015@1030-1130":
    Please Login or Register  to view this content.
    I would like the VBA code to:
    1. Loop trough the first Training Attendance sheet
    2. Check if the "Signature" column (D) is marked
    3. Look at the ID number in Column B and find the matching ID number in the Master sheet.
    4. Then go to the correct column (which has the same name as the Attendance sheet) and mark the cell in the correct column.
    5. Go to the next Training attendance sheet and repeat steps 1-5.

    So in the end my Master sheet will look something like this:
    Please Login or Register  to view this content.
    I've been struggling with this problem for two weeks now and have no idea how to write the proper VBA code instead of a long senseless VBA code full of error.

    Many thanks in advance.
    Mike
    Attached Files Attached Files
    Last edited by spikedemike; 09-30-2015 at 11:38 PM.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: VBA code to match and mark data from multiple sheets into a master sheet.

    You can do it using Formulas aswell..

    Put this in E2 and drag down and across

    =IFERROR(VLOOKUP($B2,INDIRECT("'"&E$1&"'!$B:$D"),3,0),"")

    Then I use Conditional Formatting to format zeros with white font..

    VF Formula - =E2=0 (Format with White Font)

    See the files attached (With and without VBA).

    Also here is the VBA

    Please Login or Register  to view this content.
    Make sure the Headings are exactly matching to the sheet name..
    Attached Files Attached Files
    Last edited by NeedForExcel; 10-01-2015 at 12:43 AM.
    Cheers!
    Deep Dave

  3. #3
    Registered User
    Join Date
    12-05-2014
    Location
    Hanoi, Vietnam
    MS-Off Ver
    MAC
    Posts
    9

    Re: VBA code to match and mark data from multiple sheets into a master sheet.

    Awesome!!! You're a lifesaver

    I will also try the formula, but VBA is what is was looking for.
    The Headings will be an exact match. I have a VBA code that lists all Sheet names to the first cells of each columns .

    Many thanks again.

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: VBA code to match and mark data from multiple sheets into a master sheet.

    No problem..

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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: 03-11-2015, 07:01 PM
  2. [SOLVED] Need to modify VBA Code that copies multiple sheets to a master sheet
    By AXGirl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-02-2014, 04:37 PM
  3. [SOLVED] Populate master sheet from data on multiple sheets
    By jhammond10 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-05-2013, 01:36 PM
  4. Need cut and paste data from multiple sheets to one master sheet
    By cokillerliu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2013, 06:41 PM
  5. [SOLVED] Run time error in code that extracts data from several sheets into master sheet
    By Hello23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2012, 10:11 PM
  6. Copying data from multiple sheets to master sheet
    By phong919 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-13-2010, 04:30 PM
  7. Copying row data from a Master sheet to multiple sheets
    By f3racer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2009, 08:28 PM

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