ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fill with Gray if Column b is bold (https://www.excelbanter.com/excel-programming/440644-fill-gray-if-column-b-bold.html)

C

Fill with Gray if Column b is bold
 
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

Russell Dawson[_2_]

Fill with Gray if Column b is bold
 
I don't think you can but it might be worth taking a step back and looking at
how column B is populated. What is entered? How does it get there? What
makes it format bold? If it's not manual input where does the data come from
and is there anything else that can differentiate what can and can't be
conditionally formatted?

--
Russell Dawson
Excel Student

Please hit "Yes" if this post was helpful.


"C" wrote:

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


Gord Dibben

Fill with Gray if Column b is bold
 
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

On Mon, 15 Mar 2010 09:06:01 -0700, C wrote:

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




All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com