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.
 
Here is a sample done manually a few years ago.
It is not exactly what I want but very close.
If cell is blank, do not highlight row.
If cell is not blank, the highlight the entire row in blue, for example.
The sample show alternate shading done with conditional formating. It is not what I really want.
Thanks for your patience

Ottawa Clutch. Automotive, industrial, agricultural clutches. Wichita clutches and brakes. Twin disc, NACD and Rockford Power take off
That is the same picture link that you posted earlier. I see no green and two shades of blue interior. It is really hard to tell what you actually want from a picture that is not representative. Perhaps someone else will be able to figure out what you want from what you posted, but unfortunately I can't. Me, personally... I would need to see a TRUE picture of what your worksheet should look like (not one that you think is kind of close).
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
I would like to understand this code a little better because I see the Intersect method being used and I don't really understand it.
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 'Green
  Intersect(Range("A2:A" & LastRow).SpecialCells(xlConstants).EntireRow, Columns("A:R")).Font.ColorIndex = 5 'Blue
End Sub

In the code above, what part of it determines that the first cell is empty?

Thanks.
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

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