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
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!!
1st December 2008, 03:39 PM #2
you could use the code below do to conditional formating
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")
vColor = 34
vColor = 36
Application.EnableEvents = False
cell.Interior.ColorIndex = vColor
Application.EnableEvents = True
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
I think you can only have three conditional formats, but with the code you can have as many as you need.
Originally Posted by laserblazer
By sqdge in forum Office Software
Last Post: 10th February 2013, 07:18 AM
By RabbieBurns in forum Windows
Last Post: 13th August 2008, 06:31 PM
By timbo343 in forum How do you do....it?
Last Post: 4th August 2008, 10:06 PM
By russdev in forum Office Software
Last Post: 9th May 2008, 12:51 PM
By DSapseid in forum Windows
Last Post: 7th November 2007, 05:56 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)