Reputation: 295
Here is my code
If Range("E" & i).Value > Range("C" & i).Value * 0.2 Then Range("E" & i).Interior.Color = 13619199
This line of code is meant to highlight all cells in column E if column E is 20% greater than column C. The code works. However, I want it to highlight the absolute value of E as well because I have some negative values in there as well. How do I get this line of code to take into account the negative values?
I appreciate all answers in advance.
Thanks,
G
Upvotes: 0
Views: 347
Reputation: 21639
This wasn't asked in your original question but your comments give the impression that you're unfamiliar with Conditional Formatting? This is the simplest example of what it can do (better than and quick code samples we can give you!)...
There are many other ways conditional formatting can be used, some trickier than others to setup, but all with plenty of examples available online. A commonly asked one is how to highlight an entire how based on the value of one cell.
.
Lastly, on the topic of Conditional Formatting being cooler than it sounds, a mathematician took it to a whole new level with a Conditional Formatting-based JPG-to-Excel convertor that's worth checking out!
.
Upvotes: 1