ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   autoshape macro (https://www.excelbanter.com/excel-discussion-misc-queries/162015-autoshape-macro.html)

jackrobyn1

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

Gary''s Student

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



All times are GMT +1. The time now is 03:29 AM.

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