ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can I use a macro for color coding? (https://www.excelbanter.com/excel-discussion-misc-queries/204122-can-i-use-macro-color-coding.html)

pdgarza

Can I use a macro for color coding?
 
I need some more help with these macros. Here is what I have done so far:

I have an if/then statement in cells T9:T25 that calculates the numbers I
have in cells Q9-25:S9-25. Then I changed the color of the font to orange.
Then I set up a conditional format for these cells:

less than -2%=red
2% to 10%=green
greater than 10%=blue
(anything between -2% and 2% will remain orange)

This part works great.

Now here is what I am trying:
I want the font in cells Q:S to change to the same color as the font in cell
T. So, if the font in cell T9 is red, I want the font in cell Q9:S9 to
change to red. If the color is green, I want it to change to green, and if
it is blue, I want it to change to blue.

I cannot use the conditional formatting for the values in cells Q:S because
the color is based on the value in cell T, not the value in Q:S.

So I think I need to set up a macro but I have no idea how to start it. I
dont know if I need to use an if/then statement or a select case macro.

Please help! Thanks

Jim Thomlinson

Can I use a macro for color coding?
 
Conditional formatting will still work. You need to change from cell value is
to formula is and then point Q:S back to the value in T. Note that
conditional formatting is looing for a True or False result in determining
whether or not to apply the format
--
HTH...

Jim Thomlinson


"pdgarza" wrote:

I need some more help with these macros. Here is what I have done so far:

I have an if/then statement in cells T9:T25 that calculates the numbers I
have in cells Q9-25:S9-25. Then I changed the color of the font to orange.
Then I set up a conditional format for these cells:

less than -2%=red
2% to 10%=green
greater than 10%=blue
(anything between -2% and 2% will remain orange)

This part works great.

Now here is what I am trying:
I want the font in cells Q:S to change to the same color as the font in cell
T. So, if the font in cell T9 is red, I want the font in cell Q9:S9 to
change to red. If the color is green, I want it to change to green, and if
it is blue, I want it to change to blue.

I cannot use the conditional formatting for the values in cells Q:S because
the color is based on the value in cell T, not the value in Q:S.

So I think I need to set up a macro but I have no idea how to start it. I
dont know if I need to use an if/then statement or a select case macro.

Please help! Thanks


Sean Timmons

Can I use a macro for color coding?
 
You can use Conditional formatting... The formatting should use formula
=$T9<.2 format.

The $ will free at that column. Highlight the entire row at one time when
you do it, and all columns will format appropriately.

Make sense?

"pdgarza" wrote:

I need some more help with these macros. Here is what I have done so far:

I have an if/then statement in cells T9:T25 that calculates the numbers I
have in cells Q9-25:S9-25. Then I changed the color of the font to orange.
Then I set up a conditional format for these cells:

less than -2%=red
2% to 10%=green
greater than 10%=blue
(anything between -2% and 2% will remain orange)

This part works great.

Now here is what I am trying:
I want the font in cells Q:S to change to the same color as the font in cell
T. So, if the font in cell T9 is red, I want the font in cell Q9:S9 to
change to red. If the color is green, I want it to change to green, and if
it is blue, I want it to change to blue.

I cannot use the conditional formatting for the values in cells Q:S because
the color is based on the value in cell T, not the value in Q:S.

So I think I need to set up a macro but I have no idea how to start it. I
dont know if I need to use an if/then statement or a select case macro.

Please help! Thanks


pdgarza

Can I use a macro for color coding?
 
The only problem with that is if I change it to "formula is" = to T9, it
won't change the color because it is a false statement. The formulas in
cells Q:S are all different from each other and none of the fomulas are equal
to the one in cell T.

That's why I am having so much trouble with this, but I figured a macro
could perform this color change, I just don't know how to set it up.

"Jim Thomlinson" wrote:

Conditional formatting will still work. You need to change from cell value is
to formula is and then point Q:S back to the value in T. Note that
conditional formatting is looing for a True or False result in determining
whether or not to apply the format
--
HTH...

Jim Thomlinson


"pdgarza" wrote:

I need some more help with these macros. Here is what I have done so far:

I have an if/then statement in cells T9:T25 that calculates the numbers I
have in cells Q9-25:S9-25. Then I changed the color of the font to orange.
Then I set up a conditional format for these cells:

less than -2%=red
2% to 10%=green
greater than 10%=blue
(anything between -2% and 2% will remain orange)

This part works great.

Now here is what I am trying:
I want the font in cells Q:S to change to the same color as the font in cell
T. So, if the font in cell T9 is red, I want the font in cell Q9:S9 to
change to red. If the color is green, I want it to change to green, and if
it is blue, I want it to change to blue.

I cannot use the conditional formatting for the values in cells Q:S because
the color is based on the value in cell T, not the value in Q:S.

So I think I need to set up a macro but I have no idea how to start it. I
dont know if I need to use an if/then statement or a select case macro.

Please help! Thanks


Jim Thomlinson

Can I use a macro for color coding?
 
The formula would be
=T9<.02

Which will return true if T9 is less than 2% and that will invoke the
conditional format.
--
HTH...

Jim Thomlinson


"pdgarza" wrote:

The only problem with that is if I change it to "formula is" = to T9, it
won't change the color because it is a false statement. The formulas in
cells Q:S are all different from each other and none of the fomulas are equal
to the one in cell T.

That's why I am having so much trouble with this, but I figured a macro
could perform this color change, I just don't know how to set it up.

"Jim Thomlinson" wrote:

Conditional formatting will still work. You need to change from cell value is
to formula is and then point Q:S back to the value in T. Note that
conditional formatting is looing for a True or False result in determining
whether or not to apply the format
--
HTH...

Jim Thomlinson


"pdgarza" wrote:

I need some more help with these macros. Here is what I have done so far:

I have an if/then statement in cells T9:T25 that calculates the numbers I
have in cells Q9-25:S9-25. Then I changed the color of the font to orange.
Then I set up a conditional format for these cells:

less than -2%=red
2% to 10%=green
greater than 10%=blue
(anything between -2% and 2% will remain orange)

This part works great.

Now here is what I am trying:
I want the font in cells Q:S to change to the same color as the font in cell
T. So, if the font in cell T9 is red, I want the font in cell Q9:S9 to
change to red. If the color is green, I want it to change to green, and if
it is blue, I want it to change to blue.

I cannot use the conditional formatting for the values in cells Q:S because
the color is based on the value in cell T, not the value in Q:S.

So I think I need to set up a macro but I have no idea how to start it. I
dont know if I need to use an if/then statement or a select case macro.

Please help! Thanks


pdgarza

Can I use a macro for color coding?
 
Yeah! That worked! One other thing though....how would I enter the formula
for: between .0201 and .10

"Jim Thomlinson" wrote:

The formula would be
=T9<.02

Which will return true if T9 is less than 2% and that will invoke the
conditional format.
--
HTH...

Jim Thomlinson


"pdgarza" wrote:

The only problem with that is if I change it to "formula is" = to T9, it
won't change the color because it is a false statement. The formulas in
cells Q:S are all different from each other and none of the fomulas are equal
to the one in cell T.

That's why I am having so much trouble with this, but I figured a macro
could perform this color change, I just don't know how to set it up.

"Jim Thomlinson" wrote:

Conditional formatting will still work. You need to change from cell value is
to formula is and then point Q:S back to the value in T. Note that
conditional formatting is looing for a True or False result in determining
whether or not to apply the format
--
HTH...

Jim Thomlinson


"pdgarza" wrote:

I need some more help with these macros. Here is what I have done so far:

I have an if/then statement in cells T9:T25 that calculates the numbers I
have in cells Q9-25:S9-25. Then I changed the color of the font to orange.
Then I set up a conditional format for these cells:

less than -2%=red
2% to 10%=green
greater than 10%=blue
(anything between -2% and 2% will remain orange)

This part works great.

Now here is what I am trying:
I want the font in cells Q:S to change to the same color as the font in cell
T. So, if the font in cell T9 is red, I want the font in cell Q9:S9 to
change to red. If the color is green, I want it to change to green, and if
it is blue, I want it to change to blue.

I cannot use the conditional formatting for the values in cells Q:S because
the color is based on the value in cell T, not the value in Q:S.

So I think I need to set up a macro but I have no idea how to start it. I
dont know if I need to use an if/then statement or a select case macro.

Please help! Thanks


Sean Timmons

Can I use a macro for color coding?
 
Keep in mind, Excel's logic starts at 1 and works down. So, if first is <.02,
you can make 2nd criterion <.10. Any cells below .02 will be captured by
criterion 1. All between .02 and .1 will be captured by 2.

"pdgarza" wrote:

Yeah! That worked! One other thing though....how would I enter the formula
for: between .0201 and .10

"Jim Thomlinson" wrote:

The formula would be
=T9<.02

Which will return true if T9 is less than 2% and that will invoke the
conditional format.
--
HTH...

Jim Thomlinson


"pdgarza" wrote:

The only problem with that is if I change it to "formula is" = to T9, it
won't change the color because it is a false statement. The formulas in
cells Q:S are all different from each other and none of the fomulas are equal
to the one in cell T.

That's why I am having so much trouble with this, but I figured a macro
could perform this color change, I just don't know how to set it up.

"Jim Thomlinson" wrote:

Conditional formatting will still work. You need to change from cell value is
to formula is and then point Q:S back to the value in T. Note that
conditional formatting is looing for a True or False result in determining
whether or not to apply the format
--
HTH...

Jim Thomlinson


"pdgarza" wrote:

I need some more help with these macros. Here is what I have done so far:

I have an if/then statement in cells T9:T25 that calculates the numbers I
have in cells Q9-25:S9-25. Then I changed the color of the font to orange.
Then I set up a conditional format for these cells:

less than -2%=red
2% to 10%=green
greater than 10%=blue
(anything between -2% and 2% will remain orange)

This part works great.

Now here is what I am trying:
I want the font in cells Q:S to change to the same color as the font in cell
T. So, if the font in cell T9 is red, I want the font in cell Q9:S9 to
change to red. If the color is green, I want it to change to green, and if
it is blue, I want it to change to blue.

I cannot use the conditional formatting for the values in cells Q:S because
the color is based on the value in cell T, not the value in Q:S.

So I think I need to set up a macro but I have no idea how to start it. I
dont know if I need to use an if/then statement or a select case macro.

Please help! Thanks



All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com