+ Post New Thread
Results 1 to 4 of 4
How do you do....it? Thread, Excel Formula in Technical; Hi, I am looking to write a formula to highlight childrens birthdays. Ie all of the children who have a ...
  1. #1
    denon101's Avatar
    Join Date
    Jul 2008
    Location
    Stuck in the server room......
    Posts
    395
    Thank Post
    54
    Thanked 37 Times in 35 Posts
    Rep Power
    21

    Excel Formula

    Hi,

    I am looking to write a formula to highlight childrens birthdays. Ie all of the children who have a birthday in Jan, Feb, Mar etc!! The dates are in DD/MM/YYYY format. I have spent some time looking around google and as yet have not come up with the answer.

    Any suggestions would be appreciated!!

  2. #2

    Join Date
    May 2007
    Location
    Birmingham
    Posts
    169
    Thank Post
    9
    Thanked 45 Times in 36 Posts
    Rep Power
    27
    you could use the code below do to conditional formating
    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim weekday As String
    Dim vColor As Integer
    Dim cell As Range

    For Each cell In Target
    weekday = cell.Value
    vColor = 0 'default is no color
    Select Case Format(weekday, "mmm")
    Case "Jan"
    vColor = 34
    Case "Feb"
    vColor = 36
    End Select
    Application.EnableEvents = False
    cell.Interior.ColorIndex = vColor
    Application.EnableEvents = True
    Next cell
    End Sub

    hope this helps
    Last edited by JOrdan01070; 1st December 2008 at 02:47 PM. Reason: code change

  3. #3


    Join Date
    Sep 2007
    Location
    UK
    Posts
    5,410
    Thank Post
    1,436
    Thanked 876 Times in 562 Posts
    Rep Power
    645
    Conditional Format is the way to go but if you are looking for something quick, highlight the relevant column, use Conditional Format to format the first range, then click on ADD do the next range and so on. It's not an elegant solution but it should work, assuming you can build up enough conditions. I don't know what the limit is.

  4. #4

    Join Date
    May 2007
    Location
    Birmingham
    Posts
    169
    Thank Post
    9
    Thanked 45 Times in 36 Posts
    Rep Power
    27
    Quote Originally Posted by laserblazer View Post
    Conditional Format is the way to go but if you are looking for something quick, highlight the relevant column, use Conditional Format to format the first range, then click on ADD do the next range and so on. It's not an elegant solution but it should work, assuming you can build up enough conditions. I don't know what the limit is.
    I think you can only have three conditional formats, but with the code you can have as many as you need.

SHARE:
+ Post New Thread

Similar Threads

  1. Excel Formula Copy Problem
    By sqdge in forum Office Software
    Replies: 26
    Last Post: 10th February 2013, 06:18 AM
  2. excel formula help again please
    By RabbieBurns in forum Windows
    Replies: 2
    Last Post: 13th August 2008, 05:31 PM
  3. Excel Question / Formula Needed
    By timbo343 in forum How do you do....it?
    Replies: 22
    Last Post: 4th August 2008, 09:06 PM
  4. office for mac excel formula question.
    By russdev in forum Office Software
    Replies: 2
    Last Post: 9th May 2008, 11:51 AM
  5. Excel Formula Help
    By DSapseid in forum Windows
    Replies: 4
    Last Post: 7th November 2007, 04:56 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •