VBA Code to highlight discrepancies

lahuber21

New Member
Joined
Jul 16, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi! This is my first thread ever. I've recently started teaching myself VBA by watching videos online. It has already helped many tasks at work!

What I am currently trying to figure out is:

I need my values in column E to be highlighted yellow if they do not match the total value of column H, I, J and K added together.

For example, If cell E3=10 and cell H3=8, I3=2, J3=0, K3=1....cell E3 should be highlighted yellow because cells H,I,J,K do not equal 10.

Thank you!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Welcome to the Board!

One way is to use the "Use a formula to determine which cells to format" option of Conditional Formatting.
Just select cell E3, go to Conditional formatting and choose the "Use a formula to determine which cells to format" option, enter the following formula:
=E3<>(H3+I3+J3+K3)
and then choose your yellow background color.
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

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