+ Reply to Thread
Results 1 to 11 of 11

Code to look at 2 columns, one finding like value and the other evaluating Dates

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    Maine
    MS-Off Ver
    Excel 2010
    Posts
    36

    Question Code to look at 2 columns, one finding like value and the other evaluating Dates

    I would like a Code to Ask the user for a "Date Span" then look at column "A" to find the Like PROD ID's, then look at column "P" to see if the PO Write Dates fall into the requested Date Span. This case in yellow would be a Date Span of 1 Day.


    Attachment 207559

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    Try this

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  3. #3
    Registered User
    Join Date
    08-10-2012
    Location
    Maine
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    This works perfect for what I asked for. Thank you!
    Could this be changed to have it highlight any span say Less Than the inputted number of days, say "anything Less Than 7"?


    Quote Originally Posted by OllieB View Post
    Try this

    Please Login or Register  to view this content.

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    Yes, it can. The only thing you have to do is change the following line of code

    Please Login or Register  to view this content.

  5. #5
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    Yes, it can. The only thing you have to do is change the following line of code

    Please Login or Register  to view this content.

  6. #6
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    Please remember to mark your thread as solved if the answer meets you requirement, and to click on the star icon if you are happy with my contribution.

  7. #7
    Registered User
    Join Date
    08-10-2012
    Location
    Maine
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    One more question. If I have a blank Row how to I get this Code to Skip that row and continue?



    Quote Originally Posted by OllieB View Post
    Yes, it can. The only thing you have to do is change the following line of code

    Please Login or Register  to view this content.

  8. #8
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    will the entire row be blank, just a few columns, the date column?

  9. #9
    Registered User
    Join Date
    08-10-2012
    Location
    Maine
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    Entire Row will be blank. Unles you know a way to have the Code above insert a blank "Unhighlighted" row after each Unique Prod ID. So it will look like the attachment below. I know I could do a conditional format but I'd like to eventually get this ALL to run by hitting 1 or 2 buttons.

    Attachment 207860.

    Quote Originally Posted by OllieB View Post
    will the entire row be blank, just a few columns, the date column?

  10. #10
    Registered User
    Join Date
    08-10-2012
    Location
    Maine
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    I figured it out by recording a Macro doing the Conditional Formatting. Then I created a "CallAll" Macro that "Call" each Macro after one has run.

    Quote Originally Posted by mjfox52610 View Post
    Entire Row will be blank. Unles you know a way to have the Code above insert a blank "Unhighlighted" row after each Unique Prod ID. So it will look like the attachment below. I know I could do a conditional format but I'd like to eventually get this ALL to run by hitting 1 or 2 buttons.

    Attachment 207860.

  11. #11
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Code to look at 2 columns, one finding like value and the other evaluating Dates

    Ok. Good job!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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