Dragging Conditional Formatting

akshatk1991

New Member
Joined
May 6, 2013
Messages
13
So i have a dozen tables and i want to format the colour of each column based on whether a certain cell in each column is greater than 0

So i copied the cells formula out above the table where it would be a number of 0, i then proceeded to conditionally format that column using a conditional formatting formula =$B$4>0

My issue is that i cannot drag this along the table, if i change the $ or remove them, the conditional formatting behaves differently. Is there any way to copy the formatting across the table, without manually reselecting and reapplying conditional formatting? Thanks!
 
yes, when i do that, it misses out on certain cells, making the table look like a jigsaw puzzle haha, the only version it works with is =$b$4>0
 
Upvote 0
This is the code, as you can see, i am manually moving forward, is there a way to do this faster?


Range("BK7:BK12,BK14:BK17,BK19:BK21,BK23,BK25:BK29").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$BK$5>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.Pattern = xlNone
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("BL7:BL12,BL14:BL17,BL19:BL21,BL23,BL25:BL29").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$BL$5>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.Pattern = xlNone
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

Range("BM7:BM12,BM14:BM17,BM19:BM21,BM23,BM25:BM29").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$BM$5>0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.Pattern = xlNone
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
 
Upvote 0

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