+ Reply to Thread
Results 1 to 9 of 9

Need help checking cells for correct values

  1. #1
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Need help checking cells for correct values

    I have attached a sample file to help show what I am about to explain. I am trying to make a tool that will check a weekly generated report for errors.

    Check Values Sample File.xlsx

    I need a code that will check column A for the value "Employee". If "Employee" is found, then check column B for a job name. If there is no value, then continue to the next "Employee" value in column A. If there is a value, then check column C for the Labor Type. Take the Labor Type value and look on 'Sheet2' to find the matching Job and Labor Type value and make sure the Rate on 'Sheet1' in column D is the same as 'Sheet2' column C. If the value is not the same, then I would like to turn the rate in 'Sheet1' red to show the error.

    In my sample file, I only have 3 employees, 2 jobs, and 2 labor types. These three lists will be a different length each week. So I am hoping this can be a dynamic code.

    Is this possible to achieve?

    Thank you very much!

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Need help checking cells for correct values

    Why troubling yourself in typing all these manually.
    Formulas can do that for you.

    Main formula cell--H3
    Each time you want to input labour rate, just copy the main formula cell and paste in the desired range.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Need help checking cells for correct values

    Quote Originally Posted by sourabhg98 View Post
    Why troubling yourself in typing all these manually.
    Formulas can do that for you.

    Main formula cell--H3
    Each time you want to input labour rate, just copy the main formula cell and paste in the desired range.

    Please Login or Register  to view this content.
    The reason for this is because once a week I will generate a report from a program that will export into a new excel file. So I was going to try to create a tool in my toolbar that uses code that will refer to a separate file with all the Job and Labor type data. That way I can Change the data as needed and still be able to press a button in my toolbar for each report.

    In my sample I am using two sheets, but it will really be two files. I was just trying to simplify it to get help and then later modify it to my needs.

    Does this make sense?

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Need help checking cells for correct values

    There may be a more efficient way to do it but this was off the top of my head:

    Please Login or Register  to view this content.
    If you are happy with my response please click the * in the lower left of my post.

  5. #5
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Need help checking cells for correct values

    Although, you can easily compare the results with a macro provided by @stnkynts , but I still believe that that would be easier for you to use a formula to extract labour amounts. So, why don't you keep the main formula cell in H3 of the sheet2 and create a macro which will copy the whole sheet2 to the new file which you will get each week. Then you can use the formulas easily.

    However, it is just a suggestion. You can surely go for the macro provided above @stnkynts if you particularly want to do that.

  6. #6
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Need help checking cells for correct values

    Quote Originally Posted by stnkynts View Post
    There may be a more efficient way to do it but this was off the top of my head:

    Please Login or Register  to view this content.
    I believe this is going to work great for me. The only thing I can seem to adjust is how it searches. On Sheet1 for job, my report generates additional info with the job. For example, 1310-/ 2020-. My job number is 1310, and the code seems to work if I delete everything in the cell except for 1310. Is there a way to match the job numbers from Sheet1 and Sheet2 without having to have the job values match exactly?

  7. #7
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Need help checking cells for correct values

    Is there a way to match the job numbers from Sheet1 and Sheet2 without having to have the job values match exactly?
    I depends, will it always be a 4 digit number?

  8. #8
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Need help checking cells for correct values

    Quote Originally Posted by stnkynts View Post
    I depends, will it always be a 4 digit number?
    Yes, the job number will always be a 4 digit number.

  9. #9
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Need help checking cells for correct values

    Maybe this. It would have been best if you would have submitted an accurate representation of your workbook.

    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. Not returning correct values in all cells
    By maximpinto in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-16-2015, 12:41 PM
  2. [SOLVED] Checking code format is correct or not ?
    By makinmomb in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-10-2014, 03:52 PM
  3. [SOLVED] Calculating GST and Checking that the GST is correct
    By becca26031993 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-05-2012, 11:34 PM
  4. Replies: 3
    Last Post: 06-27-2012, 05:47 PM
  5. checking whether a number of cells have values
    By LAazsx in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-05-2010, 09:47 PM
  6. Checking info against cells containing multiple values
    By systematic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2005, 03:02 AM
  7. [SOLVED] Checking if a cell entry is correct before adding it to another
    By Zakynthos in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

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