LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Toggle AutoShape Colour

Dear Excel Users

I have several Shapes on a worksheet. I want the fill colour to toggle
between two values whenever the shape is clicked. I've assigned the
following Macro to a shape with the following code:

-------------------
Sub Macro1()

ActiveSheet.Shapes("AutoShape 1").Select
Call Toggle

End Sub


Sub Toggle()

If Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10 Then
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 17
Else
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10
End If

Range("A1").Select 'so that the shape is "deselected"

End Sub
-------------------

The problem is that I need a new macro (based on Macro1) for EVERY
shape which calls the Toggle routine when clicked.

Can I assign just one Macro to ALL shapes which will toggle the colour
of the ONE shape I click on (i.e. is not specific to a given
shape/group)?

Many thanks

jw

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Toggle Cell Colour Conditionally Ken McLennan[_2_] Excel Worksheet Functions 6 September 11th 08 04:55 PM
How do I save new colour schemes for graphs in the colour template Alison Charts and Charting in Excel 1 July 22nd 06 10:35 PM
change a cell background colour to my own RGB colour requirements Stephen Doughty Excel Discussion (Misc queries) 4 June 16th 06 01:08 PM
toggle button text colour John Davies Excel Programming 2 August 8th 05 01:02 PM
Text in Blue colour, but print in black colour wuwu Excel Worksheet Functions 1 November 13th 04 02:36 PM


All times are GMT +1. The time now is 12:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"