Highlight a row if first cell contains any text

Andre B

New Member
Joined
Feb 2, 2015
Messages
7
I have a spreadsheet in which the first column contains category names in bold letters and sub-category names in regular letter. I would like to highlight in blue the whole row where the cells containing the category name in bold and the subcategory names in regular letters in green. The other cells are blanks and I do not want to highlight them. Is that possible? If so, how ? I would like to run a macro.
Thanks for your help.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I have a spreadsheet in which the first column contains category names in bold letters and sub-category names in regular letter. I would like to highlight in blue the whole row where the cells containing the category name in bold and the subcategory names in regular letters in green. The other cells are blanks and I do not want to highlight them. Is that possible? If so, how ? I would like to run a macro.
Thanks for your help.

Welcome to the board.

Can you post a small sample of your sheet and indicate the result you would like to see?
 
Upvote 0
Thanks for your reply. I want the row with Acura (which is in bold) in blue and the other rows with data in the first column(regular font) in green.
Here is a sample:
ACURA
CL COUPE
4 1997-99 2.2L & 2.3L Eng 08-014 M0804 S0805 MU31183 8 13/16" 8 7/8 1 1/32
6 2003 3.2L 5 & 6 SPD 08-048 M0822 X MU31383 9 1/2 9 3/8 1
CSX (CANADA 4 2006-08 2.0L Type S 08-600 X X MU47539 8 3/8" 8 3/8 1 1/32
4 2006-10 1.8L 08-046 MU31036
EL
4 1996-00 1.6L Eng 08-022 x x MU31182-1 8 3/8" 8 3/8 27/32
4 2001-05 1.7L Eng 08-032 x x MU31199 8 3/8" 8 3/8 27/32
INTEGRA
4 1986-89 1.6L Eng 08-006 x x MU31110 7 7/8'' 7 7/8 7/8
4 1990-91 1.8L Eng 08-017 x x MU31201 8 3/4'' 8 5/8 1
4 1992-93 1.7L & 1.8L Eng 08-027 x x MU31252 8 3/4'' 8 3/4 1 1/32
4 1994-01 1.8L Eng VTEC and Non-VTEC 08-026 M0808 S0809 MU31252-1 8 3/4'' 8 3/4 1 1/32
LEGEND COUPE
6 1986-87 2.5L Eng COUPE 08-018 M0802 S0803 MU31202 8 7/8'' 8 7/8 1
6 1986-87 2.5L Eng SEDAN 08-018 M0802 S0801 MU31202 8 7/8'' 8 7/8 1
6 1987-88 2.7L Eng 08-018 M0802 S0803 MU31202 8 7/8'' 8 7/8 1
6 1989-90 2.7L Eng 08-018 M0802 S0804 MU31202 8 7/8'' 8 7/8 1
6 1991-92 3.2L Eng 08-021 M0805 S0806 MU31255 9 1/2'' 9 1/2 1 1/32
 
Upvote 0
The sample given is a little bit different that what I want. I just want the rows with text in the first column to be highlighted. Thanks
 
Upvote 0
The sample given is a little bit different that what I want. I just want the rows with text in the first column to be highlighted. Thanks
Are you saying that if there is text in a cell in column A, you want to highlight the cells in that row with a blue fill, but do nothing if the cell in column A contains a number?

Are the numbers true numbers or text? To test, say cell A5 contains a "number", then in any empty cell enter: =ISNUMBER(A5). Does this return TRUE?
 
Upvote 0
Does this macro do what you want...
Code:
Sub HighlightDataRows()
  Dim LastRow As Long
  LastRow = Cells(Rows.Count, "B").End(xlUp).Row
  Intersect(Range("B2:B" & LastRow).EntireRow, Columns("A:R")).Font.ColorIndex = 50 [COLOR="#008000"]'Green[/COLOR]
  Intersect(Range("A2:A" & LastRow).SpecialCells(xlConstants).EntireRow, Columns("A:R")).Font.ColorIndex = 5 [COLOR="#008000"]'Blue[/COLOR]
End Sub
 
Upvote 0
Thanks for your reply.
It does not do exactly what I want. It highlights all the text in column A in blue, and the rows with no text in column A is green. The background in the rows are not highlighted
 
Upvote 0
Thanks for your reply.
It does not do exactly what I want. It highlights all the text in column A in blue, and the rows with no text in column A is green. The background in the rows are not highlighted
Can you post a picture of exactly what the worksheet should look like instead of that picture which looked nothing like you tried to describe?
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,221,443
Messages
6,159,907
Members
451,601
Latest member
terrynelson55

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top