Set Cell Colour without using Conditional Formatting

ejwjohn

Board Regular
Joined
Jul 19, 2011
Messages
93
Office Version
  1. 2016
Platform
  1. MacOS
I have been trying to use Conditional Formatting to colour cell and a Forum participant has helped me sort that out, now i have another issue, in that apparently the latest versions of Excel, and perhaps versions will not allow you to Record a Macro which uses Conditional Formatting...... so is there another way to set the background colour of a cell based on the value of the text within that cell please?

Thanks

JohnW
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I just recorded one in Excel 2016. It doesnt like the apply button so just press ok at the end. This is my recorded macro:

Code:
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=A1=""a"""
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 255
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
 
Upvote 0
Hello,

Ok, Thanks. I used your code with a slight variation and it works now i can do the rest of the Conditional Formatting using Macros.

Thanks Again

JohnW
 
Upvote 0

Forum statistics

Threads
1,223,713
Messages
6,174,043
Members
452,542
Latest member
Bricklin

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