Gareth Brown
Board Regular
- Joined
- Jul 29, 2002
- Messages
- 52
G'day, need some help modding this worksheet code to suit my needs (thanks nimrod for the template)
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address = "$A$1" Then
Select Case .Value
Case 1: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 41 'blue
Case 3: .Interior.ColorIndex = 53 'brown
Case 4: .Interior.ColorIndex = 39 'purple
Case 5: .Interior.ColorIndex = 46 'orange
Case Else
.Interior.ColorIndex = 0
End Select
End If
End With
End Sub
Essentially I need Range A1:C4 (or whatever) to change colour based on the value of A5 (or whatever)
If the code above is all mashed, it's from the thread entitled "Conditional Formating" (with the spelling mistake)
Cheers, GB
This message was edited by Gareth Brown on 2002-11-04 21:13
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address = "$A$1" Then
Select Case .Value
Case 1: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 41 'blue
Case 3: .Interior.ColorIndex = 53 'brown
Case 4: .Interior.ColorIndex = 39 'purple
Case 5: .Interior.ColorIndex = 46 'orange
Case Else
.Interior.ColorIndex = 0
End Select
End If
End With
End Sub
Essentially I need Range A1:C4 (or whatever) to change colour based on the value of A5 (or whatever)
If the code above is all mashed, it's from the thread entitled "Conditional Formating" (with the spelling mistake)
Cheers, GB
This message was edited by Gareth Brown on 2002-11-04 21:13