LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Macro for conditional formating more than 3

Try a worksheet_change function

Sub worksheet_change(ByVal target As Range)

Const YELLOW = 6
Const PINK = 7
Const GOLD = 44
Const RED = 3
Const GREEN = 10
Const BLUE = 5
Const BROWN = 53
Const ORANGE = 46

If target.Column = 1 Then
MyTarget = UCase(target)
Select Case MyTarget

Case "EM"
MyColor = PINK
Case "EV"
MyColor = ORANGE
Case Else
MyColor = xlNone

End Select

Range(Cells(target.Row, "A"), _
Cells(target.Row, "H")). _
Interior.ColorIndex = MyColor

End If

End Sub


" wrote:

Hi,

I need help on setting colors to rows depending on a cell value from
those rows.


I have a sales spreadsheet with 8 sales reps information on it.
Each row has a single invoice.


I want to assign a color to the row cell range depending on the sales
rep code.


For Example.
If on the first in column A I list the sales rep codes like "EM",
"EV", "RP" , etc


If A2 says "EM" I want the cell range A2:H2 to be pink
If A3 says "EV" I want the cell range A3:H3 to be orange


I want to set it up so when I type the sales rep code it will
automatically asign the color to the row range


Thanks in advance


 
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
Conditional formating or Macro code [email protected] Excel Discussion (Misc queries) 3 June 14th 07 04:30 PM
Conditional Formating markvdh Excel Programming 5 May 30th 06 12:11 PM
Macro row and column conditional formating problem Trevor[_8_] Excel Programming 2 January 2nd 06 04:03 PM
Conditional Formating Macro Formula Crowbar via OfficeKB.com Excel Programming 4 December 8th 05 08:21 PM
Install dates formating using conditional formating? Jerry Eggleston Excel Discussion (Misc queries) 2 November 9th 05 05:49 PM


All times are GMT +1. The time now is 03:11 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"