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

Just have the macro test the color before taking action:

Sub servient()
ActiveSheet.Shapes("AutoShape 1").Select
x = Selection.ShapeRange.Fill.ForeColor.SchemeColor
If x = 13 Then
'do something
Else
'do some othr thing
End If
End Sub
--
Gary''s Student - gsnu200749


"jackrobyn1" wrote:

I use a rectangle auto shape as a button to run a macro that enters a value
in the active cell then moves one cell to the right, then the macro changes
the colour of the rectangle so i know when its been clicked. This works
really well but is it possible to make it even better by giving the button a
duel roll?

I want the first click to run the macro as ive just said finishing with the
rectangle changing colour, then if clicked again i would like it to change
the rectangle back to its original state without entering anything in any
active cell. Is this possible?

Thanks