Baffled! Formula sometimes won't change shape colors!

gino59

Active Member
Joined
Jul 26, 2010
Messages
496
Hi all,

Hoping someone can point me in the right direction! I have the following lines in a module that sometimes work and sometimes don't... no rhyme or reason that I can see!

Basically, if the value in E17 is less than 0 change the shape color to red and if the value is greater than or equal, change it to green.

Sounds simple, eh? Not sure why sometimes it works and sometimes it doesn't! It's almost like once it turns green, even if the value gets changed to less than 0, the shape doesn't update.

Here's the code...
Code:
     If ActiveSheet.Range("E17").Value < 0 Then
          ActiveWorkbook.ActiveSheet.Shapes(4).Fill.ForeColor.SchemeColor = 16
               Else
          ActiveWorkbook.ActiveSheet.Shapes(4).Fill.ForeColor.SchemeColor = 17
     End If
     If ActiveSheet.Range("E21").Value < 0 Then
          ActiveWorkbook.ActiveSheet.Shapes(5).Fill.ForeColor.SchemeColor = 16
               Else
          ActiveWorkbook.ActiveSheet.Shapes(5).Fill.ForeColor.SchemeColor = 17
     End If

The values in cells E17 and E21 are formula generated and formatted as currency. Any ideas or suggestions greatly welcomed!!

Cheers,
Gino
 
Last edited:
Ah shg - my apologies! I obviously suffered a major brain cramp and have been slow to recover! :laugh:

DUH, DUH, DUH!! Yep, stick that snippet of code into the Calendar click module and as my french auntie used to say "Vee-ola"!!

Tough being self-taught by a dolt!! :biggrin: Obviously, the day has been too long and I am in much need of copious amounts of lager...

Thanks for your patience!

Cheers!
Gino
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Good job, Gino. All's well that ends well.
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,854
Members
452,948
Latest member
UsmanAli786

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