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: 13
Default VBA Help with changing shape color for selected shapes only

I'm in need of help. I have an Excel sheet that has some rectangle shapes.
I want to add some command buttons to change the color of these rectangles,
but I only want those shapes I select to be changed.

Here is a "Reset" command button code I use to turn all my shapes Red:

Private Sub CommandButton1_Click()
ActiveSheet.Shapes.SelectAll
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Range("A1").Select
End Sub

Now I know how to change a single shape that I specify:

ActiveSheet.Shapes("Rectangle 1").Select

But how do I change only the ones I currently have selected? And is there a
better way to unselect (deselect) rather than using Range("A1").Select?

Thanks in advance,

Scott


 
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
Calculate quantity of shapes inside another shape jlclyde Excel Discussion (Misc queries) 8 July 9th 11 06:00 AM
Changing color of selected cells in Excel 2007 desertfox13 Excel Discussion (Misc queries) 1 June 10th 09 12:46 AM
Changing default color of selected cells in 2007 Anne Reichler Excel Discussion (Misc queries) 1 October 22nd 08 10:45 PM
Changing the color of a selected range zhj23 Excel Discussion (Misc queries) 0 June 14th 07 02:38 PM
Deleting shapes/objects from a selected area Tim Excel Programming 1 October 23rd 04 01:00 AM


All times are GMT +1. The time now is 08:46 AM.

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

About Us

"It's about Microsoft Excel"