Color entire rows based on text in a column

wgb789

New Member
Joined
Apr 26, 2018
Messages
6
Hi, please help me

This has me perplexed, I have a spreadsheet up to 3000+ rows and in column "N" i have specific text "Sta" which is an indicator that this is a header row.
What I'm after is that wherever "Sta" is found that the whole row of text is colored red and bold.

Many thanks.
Bill.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try this:

Code:
Sub VbaGreenHorn1()
With Sheets("Blad1").UsedRange
    .AutoFilter 14, "Sta"
    .SpecialCells(xlCellTypeVisible).EntireRow.Font.Color = vbRed
    .SpecialCells(xlCellTypeVisible).EntireRow.Font.Bold = True
    .AutoFilter
End With
End Sub
 
Upvote 0
Hi Vbagreenhorn1,
I get an error message on : With Sheets("Blad1").UsedRange of subscript out of range.
I'm running the macro on a single spreadsheet with no specific name, also is there something I should do to qualify the .usedrange part of the code.
I'm a total beginner so when any code throws an error I'm totally in the dark as to why.
Many thanks. Bill
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,215
Members
453,024
Latest member
Wingit77

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