Home Modify Conditional Formatting 'AppliesTo' Range
Reply: 0

Modify Conditional Formatting 'AppliesTo' Range

user865 Published in June 19, 2018, 4:22 pm

I have a sheet (lets call it Sheet1) which has two existing Conditional Formatting rules. Which apply to a range in column H. The data in Sheet1 is deleted and new data is input via a database connection. This deletion and retrieval of data means the RANGE that the conditional formatting applies to changes. Is there a way I can update the CF formatting RANGE (in the Applies to box) without deleting it and recreating it in code?

pseudo-code would be something like

With Sheets("Sheet1")
.Cells.FormatConditions(1).AppliesTo = "H4:H" & .Range("H" & Rows.Count).End(xlUp).Row
.Cells.FormatConditions(2).AppliesTo = "H4:H" & .Range("H" & Rows.Count).End(xlUp).Row
End With

Any help would be appreciated, Many Thanks Caleeco

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.315541 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO