+ Reply to Thread
Results 1 to 3 of 3

VBA for Conditional Formatting of cells with different Month values

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    584

    Thumbs up VBA for Conditional Formatting of cells with different Month values

    Dear Friends,

    I have two date columns, say E & F.

    In these two columns I have entered date values. I need to do colour, font bold, Italic automatically when date values are entered in these columns - with a conditional formatting - i.e. every month should be in different color.

    For example, values 23/05/2009, 15/10/2005, 07/12/2004 must be automatically coloured with different colors as its months are different.

    Can any one please help me to solve this problem.

    Thanking you,

    acsishere.
    Last edited by acsishere; 11-14-2009 at 02:49 PM.
    Good friends are hard to find, harder to leave, and impossible to forget.

    acsishere.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: VBA for Conditional Formatting of cells with different Month values

    Hello acsishere,

    This is a 2 macro solution. A macro is added to the WorkSheet_Change event to identify when an entry has been made into either of the 2 columns. It then checks if the entry is a date. If it is a date then the second macro is called to color it by month.

    Worksheet_Change() Event Code
    Please Login or Register  to view this content.
    Macro to Change Color and Format Font of Date
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,179

    Re: VBA for Conditional Formatting of cells with different Month values

    Geez, you go to sleep for 8 hours and some one answers the post.

    Eh, this is better than my concontion.
    Regards

    Rick
    Win10, Office 365

+ 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