View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default autoshape color conditional formating

We are making progress:

A. Adaptation
1. The coding uses a shape called "Oval 1". Make sure you update to match
the name of your shape.

B. Installation
1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window


C. Usage
1. Don't assign the macro to the shape, it's designed to run manually:
2. ALT-F8
pick the macro
touch Run

If you want the macro to run automatically whenever A1 or B1 are manually
changed, update this post.
--
Gary''s Student - gsnu200786


"Dennis Collins" wrote:

Thanks for getting back to me.

I've tried the code, but it's not yet working. I'm not a VBA guy, but I
pasted the code into (General) and it's named Macro1. I've also assigned
the macro to the autoshape. I'm using A1 and B1 from the same sheet as the
autoshape, and the values in those cells are entered manually by me (not
formulas).

After pasting the code, I just 'saved' it. There must be something very
small that I'm missing, but I can't think of it. Is there anything else
special that I need to do to the autoshape?

Thanks again.
--
Dennis


"Gary''s Student" wrote:

Sub Macro1()
ActiveSheet.Shapes("Oval 1").Select
If Range("A1").Value 0 Or Range("B1").Value 0 Then
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 17
Else
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10
End If
End Sub
--
Gary''s Student - gsnu200786


"Dennis Collins" wrote:

I'm trying to have an autoshape turn either red or green dependent upon the
value in two other separate cells.

Example: if A1 0 or if B1 0, the make the autoshape green
otherwise, make the autoshape red.

Is there any VBA code out that that I could paste to do this?

Thanks for any help you can give.
--
Dennis