autoshape macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top