ststern45
Well-known Member
- Joined
- Sep 17, 2005
- Messages
- 985
- Office Version
- 365
- 2010
- Platform
- Windows
Hello everyone,
I have a set of numbers in cell range A1 through A11
I would like to format any number that matches the value in cell C1
The following code works but I wanted to ask if the code can be converted to RGB?
.ColorIndex = 6
Sub ColorCellsTest2()
Dim wS As Worksheet
Dim TdCel As Range, FCell As Range, CellVal As String
Set wS = ThisWorkbook.Sheets("Sheet1")
Set TdCel = wS.Range("A1:A11")
For Each FCell In TdCel
With FCell
CellVal = LCase(.Value)
With .Interior
Select Case True
Case CellVal = Range("C1")
.ColorIndex = 6
Case Else
.Pattern = xlNone
End Select
End With '.Interior
End With 'FCell
Next FCell
End Sub
I have a set of numbers in cell range A1 through A11
I would like to format any number that matches the value in cell C1
The following code works but I wanted to ask if the code can be converted to RGB?
.ColorIndex = 6
Sub ColorCellsTest2()
Dim wS As Worksheet
Dim TdCel As Range, FCell As Range, CellVal As String
Set wS = ThisWorkbook.Sheets("Sheet1")
Set TdCel = wS.Range("A1:A11")
For Each FCell In TdCel
With FCell
CellVal = LCase(.Value)
With .Interior
Select Case True
Case CellVal = Range("C1")
.ColorIndex = 6
Case Else
.Pattern = xlNone
End Select
End With '.Interior
End With 'FCell
Next FCell
End Sub