sadiqsabia
Registered User.
- Local time
- Today, 13:08
- Joined
- Sep 3, 2008
- Messages
- 18
I am trying to conditional format( Colours) a range of cells( C8:
AG8) to colour of another cell ( AH1) based on value in the range = value of (AH1).
Tried googling around and search the forum Can't seem to find something close. Need urgent help on these. Very new to this but required.
Found an example it is sort of what i intend and changed it but is seems not working. Help Please.
AG8) to colour of another cell ( AH1) based on value in the range = value of (AH1).
Tried googling around and search the forum Can't seem to find something close. Need urgent help on these. Very new to this but required.
Found an example it is sort of what i intend and changed it but is seems not working. Help Please.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
Dim Rng1 As Range
On Error Resume Next
Set Rng1 = ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas, 1)
On Error GoTo 0
If Rng1 Is Nothing Then
Set Rng1 = Range(Target.Address)
Else
Set Rng1 = Union(Range(Target.Address), Rng1)
End If
For Each Cell In Rng1
Select Case Cell.Value
Case vbNullString
Cell.Interior.ColorIndex = xlNone
Cell.Font.Bold = False
Case activesheet.cells("AH1").value
Cell.Interior.ColorIndex = 3
Cell.Font.Bold = True
Case Else
Cell.Interior.ColorIndex = xlNone
Cell.Font.Bold = False
End Select
Next
End Sub