Highlighting a row and the one below it

Jon_London

New Member
Joined
Jan 24, 2019
Messages
12
Office Version
  1. 365
Hi there everyone

I'm stuck on a highlighting issue and wonder if someone could please help.

I have a spreadsheet containing around 180,000 rows, some of which have the number 2 in column H. What I'm trying to achieve is to highlight the all rows in some way that contain the number in H, but also highlight the row below those rows.

So, if Row 1500 contains 2 in column H, then I'd like to highlight both Row 1500 and 1501.

Many thanks for your help.

Jon
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You should be able to use Conditional Formatting on it.
Highlight row 1 and enter this CF formula:
=$H1=2
and choose your highlighting color choice

Then choose the rest of the rows (starting with row 2) and use this CF formula
=OR($H2=2,$H1=2)
and choose your highlighting color choice
 
Last edited:
Upvote 0
You can use conditional formatting to do this.
Select the cells you want to format

In conditions formatting select new rule
then select use formula to determine which cells to format
use this formula

Code:
=OR($H2=2,$H1=2)

Select your formatting.

If this starts in row 1 with no headers then when you do the above do not select row one instead make a different rule for row 1 and use
Code:
=H1=2
 
Upvote 0
If this starts in row 1 with no headers then when you do the above do not select row one instead make a different rule for row 1 and use
Code:
=H1=2
We are both saying the same thing, but just note that if you want to highlight the whole row, you will need a "$" in front of the "H" (like I showed in my reply and you showed in your other rule).
 
Upvote 0
DOH! did not even notice that I forgot to lock the column
 
Upvote 0

Forum statistics

Threads
1,215,047
Messages
6,122,858
Members
449,096
Latest member
Erald

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