condition format - greater than and lower than

VbaHell

Well-known Member
Joined
Jan 30, 2011
Messages
1,220
Hello all

Can you help on this please as I have brain freeze

I want this VBA line of code to say = "=$F10 >4 but <8

[With Range("$F$10:F" & LR)
.Select
.FormatConditions.Add Type:=xlExpression, Formula1:="=$F10>6"
.FormatConditions(.FormatConditions.Count).Interior.Color = RGB(153, 255, 102)
End With]
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Change this line:
VBA Code:
.FormatConditions.Add Type:=xlExpression, Formula1:="=$F10>6"
to this:
VBA Code:
.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($F10>4,$F10<8)"
 
Upvote 0
Solution
Change this line:
VBA Code:
.FormatConditions.Add Type:=xlExpression, Formula1:="=$F10>6"
to this:
VBA Code:
.FormatConditions.Add Type:=xlExpression, Formula1:="=AND($F10>4,$F10<8)"
that's great, thank you very much
 
Upvote 0
You are welcome.
 
Upvote 0

Forum statistics

Threads
1,215,706
Messages
6,126,334
Members
449,309
Latest member
kevinsucher

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