Whats wrong with this!!!!!

N

Noob McKnownowt

hey guys, i got a problem

i am using colours to trigger events in my code, everything works fine apart
from the event triggered by green, heres my code:

If Weekday(Now()) = vbWednesday Then
For Each CellWed In RngWed
If WorksheetFunction.IsNumber(CellWed.Value) And CellWed.Value <=
17.59 And CellWed.Font.Color <> RGB(255, 0, 0) And CellWed.Font.Color <>
RGB(0, 255, 0) And CellWed.Font.Color <> RGB(0, 0, 255) Then
CountEmp = CountEmp + 1
ElseIf CellWed.Font.Color = RGB(255, 0, 0) Then
CountHalfDay = CountHalfDay + 1
ElseIf CellWed.Value = "Holiday" Then
CountHoliday = CountHoliday + 1
ElseIf CellWed.Font.Color = RGB(0, 255, 0) Then
CountSickHD = CountSickHD + 1
ElseIf CellWed.Value = "Sick" Then
CountSick = CountSick + 1
ElseIf CellWed.Value = "A/A" Or CellWed.Value = "A\A" Then
CountAabsence = CountAabsence + 1
ElseIf CellWed.Font.Color = RGB(0, 0, 255) Then
CountAabsenceHD = CountAabsenceHD + 1
ElseIf CellWed.Value = "U/A" Or CellWed.Value = "U\A" Then
CountUnabsence = CountUnabsence + 1
ElseIf CellWed.Value = "S/U" Or CellWed.Value = "S\U" Then
CountSuspend = CountSuspend + 1
End If
Next CellWed

i know what you may be thinking i am selecting the wrong font colour green,
just to let you know i am selecting the green that is 4 columns in from the
left and one row down on the excel colour palette, funnily enough the one
tagged "green" both the blue and red work fine. why does this code not work?

please help!!

The Noob.
 
J

Joel

there are no evvent that will be triggered when the formating or color gets
changged in a workbook.
 
D

dbKemp

hey guys, i got a problem

i am using colours to trigger events in my code, everything works fine apart
from the event triggered by green, heres my code:

If Weekday(Now()) = vbWednesday Then
For Each CellWed In RngWed
If WorksheetFunction.IsNumber(CellWed.Value) And CellWed.Value <=
17.59 And CellWed.Font.Color <> RGB(255, 0, 0) And CellWed.Font.Color <>
RGB(0, 255, 0) And CellWed.Font.Color <> RGB(0, 0, 255) Then
CountEmp = CountEmp + 1
ElseIf CellWed.Font.Color = RGB(255, 0, 0) Then
CountHalfDay = CountHalfDay + 1
ElseIf CellWed.Value = "Holiday" Then
CountHoliday = CountHoliday + 1
ElseIf CellWed.Font.Color = RGB(0, 255, 0) Then
CountSickHD = CountSickHD + 1
ElseIf CellWed.Value = "Sick" Then
CountSick = CountSick + 1
ElseIf CellWed.Value = "A/A" Or CellWed.Value = "A\A" Then
CountAabsence = CountAabsence + 1
ElseIf CellWed.Font.Color = RGB(0, 0, 255) Then
CountAabsenceHD = CountAabsenceHD + 1
ElseIf CellWed.Value = "U/A" Or CellWed.Value = "U\A" Then
CountUnabsence = CountUnabsence + 1
ElseIf CellWed.Value = "S/U" Or CellWed.Value = "S\U" Then
CountSuspend = CountSuspend + 1
End If
Next CellWed

i know what you may be thinking i am selecting the wrong font colour green,
just to let you know i am selecting the green that is 4 columns in from the
left and one row down on the excel colour palette, funnily enough the one
tagged "green" both the blue and red work fine. why does this code not work?

please help!!

The Noob.

On my pallet the 4th over and 2nd down is a dark green. When I color
the font with the 4th over and 4th down (a bright light green) I think
your code works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top