Help Required to color Interior if the Goal value is lesser than the Actual

xlhelp15

Board Regular
Joined
Sep 12, 2014
Messages
115
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Goal

[/TD]
[TD]07/02/18
[/TD]
[TD]07/03/18
[/TD]
[TD]07/04/18
[/TD]
[TD]07/05/18
[/TD]
[/TR]
[TR]
[TD]50
[/TD]
[TD]20

[/TD]
[TD]56
[/TD]
[TD]65
[/TD]
[TD]130
[/TD]
[/TR]
[TR]
[TD]50
[/TD]
[TD]22

[/TD]
[TD]25
[/TD]
[TD]35
[/TD]
[TD]85
[/TD]
[/TR]
[TR]
[TD]106
[/TD]
[TD]130
[/TD]
[TD]120
[/TD]
[TD]85
[/TD]
[TD]99
[/TD]
[/TR]
[TR]
[TD]120
[/TD]
[TD]115
[/TD]
[TD]160
[/TD]
[TD]55
[/TD]
[TD]96
[/TD]
[/TR]
[TR]
[TD]150
[/TD]
[TD]16
[/TD]
[TD]175
[/TD]
[TD]199
[/TD]
[TD]12
[/TD]
[/TR]
</tbody>[/TABLE]

Hi - I need a macro which needs to fill the colorindex=22 whenever the ACTUAL is lesser than the GOAL.

For eg,

in row 2 - date -07/2,03 & 04 is lesser than the goal. It needs to highlights interior color= 22.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi xlhelp15,

You do not NEED VBA for this, you can get the results you need by using Conditional Formatting. It maybe easer to maintain and faster than VBA. The Conditional Formatting is on the Home Ribbon in the Style section
 
Upvote 0
I have tried the same way earlier, but my data range is huge. it has minimum 30000 rows to apply conditional formatting. could you please help me with the vba ?
 
Upvote 0
I would also recommend CF rather than VBA.
If your data starts in A1 (row 1) being a header.
Simply select B2 to the end of your data & use this formula
=B2<$A2
This will then work over your entire data set
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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