Fill with Gray if Column b is bold

  • Thread starter Thread starter C
  • Start date Start date
C

C

My spreadsheet contains data from column A1 to K?. There may be 10 rows or
1000 rows. I need to look at column B and if it the font is bold then I need
to fill A:K with gray. Can someone help?

Thanks in advance,

CB
 
Sub fill_gray()
Dim rng As Range
Dim c As Range
Set rng = ActiveSheet.Range(Cells(1, 2), _
Cells(Rows.Count, 2).End(xlUp))
For Each c In rng
If c.Font.Bold = True Then
Range("A" & c.Row & ":K" & c.Row).Interior.ColorIndex = 15
Else
Range("A" & c.Row & ":K" & c.Row).Interior.ColorIndex = xlNone
End If
Next c
End Sub


Gord Dibben MS Excel MVP
 
Back
Top