Hey Guys,
New to the forum. All my other problems I've been able to work out. However I'm stuck on this code.
I'm trying to format rows based on a word in a separate column. Not through conditional formatting.
I found this code on another post which I have manipulated to what I want it to do, but I now get a run time error 438 when execute the code
If I debug it highlights the following ".Font.ColourIndex = fc"
A solution with an explanation would be much appreciated so I can learn from my mistake.
Sub Find_First()
Dim c As Range, d As Range, fc As Long, fb As Boolean
Set d = Range("D5:D100")
If d Is Nothing Then Exit Sub
For Each c In d
Select Case UCase(c)
Case "HOLD"
fc = 22: fb = False
Case "CONSTRUCTION"
fc = 41: fb = False
Case "COMPLETE"
fc = 15: fb = False
Case "PROGRESSING"
fc = 12: fb = False
Case "DESIGN"
fc = 1: fb = True
Case Else
fc = 1: fb = False
End Select
With Cells(c.Row, 1).Resize(, 4)
.Font.ColourIndex = fc
.Font.Bold = fb
End With
Next
End Sub
Bookmarks