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 ...
-
1st December 2008, 03:22 PM #1 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!!
-
-
IDG Tech News
-
1st December 2008, 03:39 PM #2 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 03:47 PM.
Reason: code change
-
-
1st December 2008, 04:20 PM #3 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.
-
-
1st December 2008, 04:34 PM #4 
Originally Posted by
laserblazer
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:
Similar Threads
-
By sqdge in forum Windows
Replies: 23
Last Post: 9th April 2012, 07:18 PM
-
By RabbieBurns in forum Windows
Replies: 3
Last Post: 13th August 2008, 05:31 PM
-
By timbo343 in forum How do you do....it?
Replies: 22
Last Post: 4th August 2008, 09:06 PM
-
By russdev in forum Office Software
Replies: 2
Last Post: 9th May 2008, 11:51 AM
-
By DSapseid in forum Windows
Replies: 4
Last Post: 7th November 2007, 05: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
-
Forum Rules