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

xlhelp15

Board Regular
Joined
Sep 12, 2014
Messages
116
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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

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