Right click sheet tab>view code>insert this
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Or Target.Column <> 1 Then Exit Sub
Select Case LCase(Target)
Case Is = "one": x = 1
Case Is = "one": x = 1
Case Is = "two": x = 6
Case Is = "three": x = 3
Case Is = "four": x = 4
Case Else
End Select
Rows(Target.Row).Interior.ColorIndex = x
End Sub
Don Guillett
SalesAid Software
dguille...@gmail.com
-----Original Message-----
From: FJO
Sent: Tuesday, November 15, 2011 7:49 AM
To: MS EXCEL AND VBA MACROS
Subject: $$Excel-Macros$$ Conditional formatting of entire row using VBA
Hi
Can anyone help me with the VBA code for conditional formatting in
Excel.
I have af worksheet of 1000 rows with 5 colums. I have data in colum
B;E and would like Excel to format the rows in a colour depending of
what I write in colum A.
I have 5 different text imput I can chose for each row, lets call
them
"one"
"two"
"Three"
"Four"
"Five"
...just to keep this example as simple as possible.
If I write "one" in A2, I would like Excel to color Row 2 in one
color, if I write "Two" then another color and so on.
I found out how to color the cell I changed, but I would like to have
the whole row colored.
I hope someone can send me an example.
--
FORUM RULES (934+ members already BANNED for violation)
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security
measure.
4) Acknowledge the responses you receive, good or bad.
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited.
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com
--
FORUM RULES (934+ members already BANNED for violation)
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited.
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com