condition formating with VBA

VbaHell

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

I need help please on this statement for condition formating
I want to only format the row from A:C.& G:J if the value in J is "Open" but it's formating row's D,E,F as well

[
LR = Range("B" & Rows.Count).End(xlUp).Row

With Range("$A$8:C" & LR, "$G$8:J" & LR)
.Select
.FormatConditions.Add Type:=xlExpression, Formula1:="=$J8=""Open"""
.FormatConditions(.FormatConditions.Count).Interior.Color = RGB(255, 100, 100)
End With]

Any help would be great please
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi,
try changing this line

VBA Code:
With Range("$A$8:C" & LR, "$G$8:J" & LR)

to this

VBA Code:
With Range("$A$8:C" & LR & "," & "$G$8:J" & LR)

and see if resolves your issue

Dave
 
Upvote 0
Hi,
try changing this line

VBA Code:
With Range("$A$8:C" & LR, "$G$8:J" & LR)

to this

VBA Code:
With Range("$A$8:C" & LR & "," & "$G$8:J" & LR)

and see if resolves your issue

Dave
Dave that works great, thank you very much
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

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