+ Reply to Thread
Results 1 to 8 of 8

VBA Conditional Format

  1. #1
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    VBA Conditional Format

    Hi All,

    I'm having an issue with a conditional formating reference. Here is my current code:

    Please Login or Register  to view this content.
    The dates in G1 and J1 are user defined, but any dates in columns C or D are static. Everything works fine so far unless the user enters a date in G1 that is less than any date in Column C, which goofs up all the formatting.

    My question is, would there be any way to check if the date in G1 is less than any date in column C, then perform an event if true?

    Something like:
    Please Login or Register  to view this content.
    (which doesnt work).

    Any help would be greatly appreciated, thanks!

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: VBA Conditional Format

    Seems to me you got this yourself, so I guess I must be missing something

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: VBA Conditional Format

    Hello Bob, thanks for the reply!

    When I run that code I get a message box for every instances of a date in column C, which is several hundred, also it runs regardless of the date value in G1.

    Thanks

  4. #4
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: VBA Conditional Format

    The closest I have gotten is this:
    Please Login or Register  to view this content.
    Which always gives the message box regardless of date for some reason. Perplexing!

  5. #5
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: VBA Conditional Format

    What values do you have in G1 and C2?

  6. #6
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: VBA Conditional Format

    G1= 7/15/14
    C2= 3/11/14

    Thanks

  7. #7
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: VBA Conditional Format

    This works for me, assuming you have real dates in those cells

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: VBA Conditional Format

    Thanks Bob, it works well execpt for the message box showing up regardless of date, so I ended up deleting the message box and using the code to just exit before the rest of the conditional formating.

    Appreciate the help!

+ 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: 3
    Last Post: 05-15-2013, 12:16 AM
  2. [SOLVED] Copy Conditional Format only without over writing existing format
    By RobNorwichUK in forum Excel General
    Replies: 2
    Last Post: 01-22-2013, 12:20 PM
  3. Replies: 2
    Last Post: 09-26-2012, 04:43 AM
  4. Replies: 0
    Last Post: 05-20-2011, 02:33 PM
  5. Replies: 6
    Last Post: 08-02-2010, 04:05 PM

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