VBA Condtional Formatting for Chart

campbesj7

New Member
Joined
Feb 25, 2016
Messages
8
Hi there,

Trying to use VBA for apply conditional formatting to a chart of data. Would like to see all cells in the selected range with a value greater than or equal to 0.65. The code I have works, somewhat, but only checks if the first cell in the row has the value, not each individual cell.

Range(Cells(RangeStart, 4), Cells(ActiveCell.Row, 15)).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:=Cells(10, 4) >= 0.65
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = RGB(255, 0, 255)
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = True

The result of this colors the following row entirely pink, when I am looking to have it only shade those cells that are greater

0.67 0.6 0.34 0.33 0.38 0.33 0.32 0.33 0.3 0.3 0.29 0.31

Any help would be greatly appreciated,
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi

Welcome to the board

Try:

Code:
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual, Formula1:="=0.65"
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,178
Members
449,071
Latest member
cdnMech

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