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: 81
Default Change order of Shapes with a click

I have eight shapes on a sheet. I'd like to be able to click on a
shape and if its zorder is 1, bring it to the front. If not, send it
to the back. The following code does this but I must name each shape
and have a chunck of code for each shape.

How can I genericize this so that whatever shape is clicked, it will
change order?

Sub ToggleOrder()

If ActiveSheet.Shapes("NameOfShape").ZOrderPosition <= 1 Then
ActiveSheet.Shapes("NameOfShape").ZOrder msoBringToFront
Else
ActiveSheet.Shapes("NameOfShape").ZOrder msoSendToBack
End If

End Sub

- John

 
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
How to change series plotting order without changing legend order? PatrickM Charts and Charting in Excel 6 December 2nd 09 07:43 PM
How to change shapes for Cell Comments Jan T.[_3_] Excel Discussion (Misc queries) 3 December 15th 08 11:10 PM
How to change syperlink from single click to double click syperlinker Excel Worksheet Functions 0 June 13th 08 05:01 PM
Selection order problem with code for shapes connection [email protected] Excel Programming 2 August 12th 05 02:03 PM
trapping click events on shapes Matt I Excel Programming 3 August 15th 03 08:17 PM


All times are GMT +1. The time now is 01:06 PM.

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"