+ Reply to Thread
Results 1 to 4 of 4

Match dates from 2 different columns

  1. #1
    Forum Contributor
    Join Date
    03-14-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    491

    Match dates from 2 different columns

    Can someone help with a vba code that can match the dates in column G & J

    If there is a match I want the formatting colors should match cell C8
    if not...
    then the formatting colors should match C10

    see attached workbook.

    Thank You for any assistance.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Match dates from 2 different columns

    perhaps try this
    Please Login or Register  to view this content.
    NB: This was edited from initial version because the bits in red earlier had the Int bit not included. That was just to ensure that the hours and minutes etc. in Col G didn't confuse the issue.
    Last edited by kalak; 10-08-2014 at 08:24 PM.

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    491

    Re: Match dates from 2 different columns

    Quote Originally Posted by kalak View Post
    perhaps try this
    Please Login or Register  to view this content.
    NB: This was edited from initial version because the bits in red earlier had the Int bit not included. That was just to ensure that the hours and minutes etc. in Col G didn't confuse the issue.
    Thank You,
    By the way why the a(45000) as Boolean, b(45000) as boolean?

  4. #4
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Match dates from 2 different columns

    "By the way why the a(45000) as Boolean, b(45000) as boolean?"
    Dates on my computer run from Jan 1 1900, which is 1 in general format (or, if you like, as the computer stores it) and onwards so that March 15 2023 is 45000 is general format.

    I assumed your dates wouldn't be outside this range, although can just increase the 45000 if considering say the next century. Earlier than the start of last century is very doable but requires a minor additional step.

    So setting say boolean a(September 1, 2014), or if you like a(41833), as True and then looking whether the dates in the other column are boolean true or boolean false indicates whether or not the date September 1, 2014 occurs in the other column.

    That part of the code is very fast. Coloring each cell individually is a lot slower but can easily be made plenty faster if you've got lots of data, say a million or so rows to compare.

+ 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: 1
    Last Post: 06-18-2013, 06:32 PM
  2. [SOLVED] Highlight Group of Dates if Dates Match List of other Dates
    By martinpgibson in forum Excel General
    Replies: 5
    Last Post: 10-24-2012, 08:14 PM
  3. [SOLVED] Match text in 2 columns, if true output adjacent cell to the match.
    By kenoboy in forum Excel General
    Replies: 3
    Last Post: 07-03-2012, 09:52 AM
  4. Replies: 5
    Last Post: 04-10-2012, 07:09 PM
  5. Replies: 4
    Last Post: 02-02-2012, 09:24 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