Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Whats wrong with this!!!!!

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Whats wrong with this!!!!!

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

"Noob McKnownowt" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Whats wrong with this!!!!!

On Jan 14, 5:35 am, Noob McKnownowt
wrote:
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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
whats wrong with this? brownti via OfficeKB.com Excel Discussion (Misc queries) 10 February 12th 07 02:39 PM
Whats Wrong With This Tinkerbell Excel Programming 2 January 12th 07 03:41 PM
Whats wrong with this? Metrazal[_16_] Excel Programming 1 February 24th 06 03:53 PM
Whats Wrong with this?? drvortex Excel Worksheet Functions 1 October 30th 04 06:48 PM
Whats wrong? Lee Excel Programming 0 July 14th 04 05:04 PM


All times are GMT +1. The time now is 01:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"