View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
LiAD LiAD is offline
external usenet poster
 
Posts: 386
Default Conditional Format

Sorry should have said its 2003 and I need the range to go horizontal not
vertical.

Thanks

"LiAD" wrote:

Thanks,

Works fine for A1 but how do i extend the range? Sorry I know zero on VB.

Thanks

"Mike H" wrote:

Hi,

One way is to tilise the worksheet change event and select case.

Right click your sheet tab, view code and paste this in which currently
works on A1 change the vauluse and colours to suit

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Range("A1").Value
Case Is = 1
icolor = 6
Case Is = 2
icolor = 9
Case Is = 3
icolor = 12
Case Is = 5
icolor = 15
Case Is = 6
icolor = 22
Case Else
icolor = xlNone
End Select
Range("A1").Interior.ColorIndex = icolor
End Sub

Mike

"LiAD" wrote:

Hi,

Is there any way to extend a conditional format to greater than three
conditions? I need five.

Thanks