How do I write a Macro in Excel for colored cells based off Criteria

fordintern

New Member
Joined
Jun 13, 2013
Messages
3
Im not good with macros at all and I need help.
For the Green cell, I want it to turn green if the number is <+-10%
For the Red Cell, I want it to turn green if the number is greater than >+-10%

TO calculate the percentages at the bottom, follow this formula,

SlopeX50° / D$6-D$7

D6= 0.00035
D7= -0.00035


I can also email you my excel file, if you have any questions. Because I have no ideal how to make macros in excel for this. Thanks for the help. Much appreciated.
115.00000-0.00135-0.00122-0.00042-0.00043
112.00000-0.00137-0.00125-0.00041-0.00044
110.00000-0.00136-0.00124-0.00036-0.00041
104.00000-0.00134-0.00125-0.00031-0.00036
103.00000-0.00133-0.00123-0.00033-0.00036
102.00000-0.00134-0.00125-0.00034-0.00039
99.20000-0.00133-0.00124-0.00031-0.00035
97.10000-0.00130-0.00123-0.00033-0.00035
95.30000-0.00135-0.00125-0.00033-0.00037
93.50000-0.00133-0.00124-0.00031-0.00034
91.50000-0.00132-0.00125-0.00033-0.00035
89.70000-0.00134-0.00126-0.00036-0.00039
87.60000-0.00134-0.00126-0.00035-0.00038
85.40000-0.00133-0.00126-0.00034-0.00040
84.50000-0.00134-0.00126-0.00032-0.00038
Slope-0.00000080.0000009-0.0000020-0.0000015
Slope X 50°-0.0000420.000044-0.000098-0.000074
as percent-5.9%6.2%-16.4%-12.4%

<COLGROUP><COL style="WIDTH: 117pt; mso-width-source: userset; mso-width-alt: 5705" width=156><COL style="WIDTH: 50pt; mso-width-source: userset; mso-width-alt: 2450" width=67><COL style="WIDTH: 124pt; mso-width-source: userset; mso-width-alt: 6034" span=3 width=165><COL style="WIDTH: 63pt; mso-width-source: userset; mso-width-alt: 3072" width=84><TBODY>
</TBODY>
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Welcome to the message board. Have you considered using conditional formatting to do this (see Excel Help)?
And do you mean green if >= -10% and red if < -10% (-16% is < -10% for example)
 
Upvote 0

Forum statistics

Threads
1,216,765
Messages
6,132,594
Members
449,737
Latest member
naes

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