Selecting Row based on a Cell Value

ERed1

Board Regular
Hi all,

I have data that is always changing. I need a macro that searches through column AH for the word "Black". If the word "Black" is found then that row gets selected and the font gets changed to red. I have to code for the red font, I just cant figure out how to select the specific row.

Here is the code for the red font:
Code:
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
Thank you in advance!
 

Fluff

MrExcel MVP, Moderator
Why not use conditional formatting, rather than a macro?
Also do you want the font for the entire row to be red, or just that cell?
 

ERed1

Board Regular
I didn't even think about that. I would I set up the rule for it? I haven't used conditional formatting before.
 

ERed1

Board Regular
Haha didn't see that. I would like just the font to be red if possible.
 

ERed1

Board Regular
The whole row should have red font, if the cell in AH has "Black" as a cell value.
 

Fluff

MrExcel MVP, Moderator
Ok, select your data & then in Conditional Formating > New rule > Use a formula & enter
=$AH2="Black"
Then select the format & Ok.
This assumes that the first row you selected is row 2, if not change $AH2 to match the first selected row.
 

ERed1

Board Regular
Ok, select your data & then in Conditional Formating > New rule > Use a formula & enter
=$AH2="Black"
Then select the format & Ok.
This assumes that the first row you selected is row 2, if not change $AH2 to match the first selected row.
This worked perfectly. Thank you.
 

Some videos you may like

This Week's Hot Topics

  • Get External Data (long shot question!)
    This is likely a long shot but I am wondering if it is at all possible for Excel to somehow 'change' the contents of a URL that is being linked to...
  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • Cell Formatting
    Good Morning, I need to format a few different cells in the following manners: A1 has to always add a colon (:) after whatever is typed in by a...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • Workbook_Change stopped working !
    I am working on an app to speed up & automate processing of Credit Cards statements. After data is input from a CSV file, it is presented to the...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
Top