ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Formating with VBA help needed (https://www.excelbanter.com/excel-programming/283782-conditional-formating-vba-help-needed.html)

Christian P

Conditional Formating with VBA help needed
 

Hello all,

This is the first time i post here and first experience in Exce
programming, i have basic knowledge in VBA for access tho.

I am making worksheets that will be calendar.

Each worksheets are for individual months.

We will use it to see wich guy is where that day IE: annual leaves
sick leaves, on a course, out for inspection etc...

What i want it to do is that if in a cell lets say 4 jan for joe blo
we enter the letter A (for annual leave) the background will switch t
red. I know i can do that with conditional formatting but it is limite
to only 3 conditions, and i will have more options then that.

A for Annual
S for sick
C for course
I for inspection
ect....

Thanx for help.

Chri

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


Don Guillett[_4_]

Conditional Formating with VBA help needed
 
Use a select case macro that is automatic. Modify to suit
right click sheet tabview codeinsert thisSAVE

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row 4 And Target.Column = 1 Then
Select Case Target.Value
Case "A"
Target.Interior.ColorIndex = 5
Case "S"
Target.Interior.ColorIndex = 6
Case "C"
Target.Interior.ColorIndex = 7
Case "I"
Target.Interior.ColorIndex = 8
Case Else
Target.Interior.ColorIndex = 0
End Select
End If
End Sub


--
Don Guillett
SalesAid Software

"Christian P" wrote in message
...

Hello all,

This is the first time i post here and first experience in Excel
programming, i have basic knowledge in VBA for access tho.

I am making worksheets that will be calendar.

Each worksheets are for individual months.

We will use it to see wich guy is where that day IE: annual leaves,
sick leaves, on a course, out for inspection etc...

What i want it to do is that if in a cell lets say 4 jan for joe blo,
we enter the letter A (for annual leave) the background will switch to
red. I know i can do that with conditional formatting but it is limited
to only 3 conditions, and i will have more options then that.

A for Annual
S for sick
C for course
I for inspection
ect....

Thanx for help.

Chris


------------------------------------------------
~~ Message posted from
http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 10:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com