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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

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