Formula for conditional formating to colour 15 cells if value = a in one?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,
Ok so I'm looking for away to set up condional formatting or a vba to do the following

Range AL51:AL800

if cell value = "a" then cell and the 14 cells above true, or colour fill white.

so basically, for every cell in the range if there's an "a" that cell and the 14 above it are filled white?

please help if you can thanks

Tony
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
How about
=COUNTIF(AL51:AL65,"a")
 
Upvote 0
Tony,
With range AL51:AL800 selected enter the following custom formula.

Code:
=COUNTIF(AI51:AI65,"a")>=1

I think that should do it provided you do not get any stray a's in Al below 800
You will need to tweak if you want cells above row51 to be white based on AL51 =a

Hope that helps.
 
Upvote 0
Try:
Code:
Sub fillRange()
    Application.ScreenUpdating = False
    Dim rng As Range
    For Each rng In Range("AL51:AL800")
        If rng = "a" Then
            Cells(rng.Row - 14, "AL").Resize(15).Interior.ColorIndex = xlNone
        End If
    Next rng
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thanks Snakehips, seams to be working,
mumps, really handy to have this as it often more stable doing it that way so thank you.
Tony
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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