+ Reply to Thread
Results 1 to 3 of 3

Compare 2 columns with 2 other columns in a different sheet, then insert date in that row

  1. #1
    Registered User
    Join Date
    07-20-2017
    Location
    Cleveland, OH
    MS-Off Ver
    2013
    Posts
    2

    Compare 2 columns with 2 other columns in a different sheet, then insert date in that row

    I apologize if this has been discussed but I have not been able to find anything that has helped me. I am not familiar with Excel VBA at all and I only have a very little bit of self taught VBA experience in Access. I have also tried this in many ways based on codes I have found online and none of them are working properly but I am sure that is my fault.

    I have two excel sheets in the same workbook. The first one contains col. 1, 2 and 3; the second sheet contains col. 1, 2, and 3. I need for my employees to be able to fill out the first sheet (they are not tech savvy enough to go to a second sheet and flip between them) and have it search the second sheet.

    Column 1 in both sheets contain a location (ex. Hallway, Room 2, Stairway), column 2 contains a fixture (ex. A, B, C, D) and Column 3 contains a quantity. Sheet 2 has the location and fixture already filled in, I need for the employees to enter the location, fixture and how many they worked with that day. When they enter this I am trying to write some code that will search for the matching location and fixture in sheet 2, when it finds the match it will add the quantity entered to the quantity column (3). I also need it to add to that column because if they go back to the same location with the same fixtures I need the quantities to combine.

    I apologize that this is so in depth but I hope someone might be able to help. The only code I have gotten to partially work so far is below but the comparison didn't work properly and I definitely couldn't figure out how to add the quantity. You're help would be very much appreciated!!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,522

    Re: Compare 2 columns with 2 other columns in a different sheet, then insert date in that

    It probably will help if you attach a before and after workbook.

  3. #3
    Registered User
    Join Date
    07-20-2017
    Location
    Cleveland, OH
    MS-Off Ver
    2013
    Posts
    2

    Re: Compare 2 columns with 2 other columns in a different sheet, then insert date in that

    I don't really know what you mean by before and after, the data stays but when it is supposed to say "Yes" or "No" It all just says "yes". This was used just to see if the comparison was working and it obviously wasn't. I am vaguely familiar with If Then statements but not the Looping statements so that is throwing me off quite a bit. I have attached my workbook with the code on it. It is in module one and runs when the document is opened.
    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)

Similar Threads

  1. [SOLVED] Compare two columns on separate sheet, if missing, insert missing data
    By lilvictorians in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-03-2019, 11:44 PM
  2. Compare to columns and insert row different sheet
    By spoon_009 in forum Excel General
    Replies: 2
    Last Post: 12-04-2015, 11:17 AM
  3. Macro to Compare two columns and publish sheet name in case columns dont match
    By adaws in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2014, 01:21 PM
  4. Replies: 1
    Last Post: 10-04-2012, 02:31 PM
  5. Replies: 4
    Last Post: 06-14-2012, 11:23 AM
  6. Replies: 4
    Last Post: 04-05-2012, 11:30 AM
  7. How to compare two pair columns and insert value from another column
    By dareme in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2010, 01:08 AM

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