Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Changing color of a shape

I have a rectangle in a spreadsheet, when I click on it I run a macro to do
some things and I want to change it's color. I have the following code but
it does not work:

With ActiveSheet.Shapes("Rectangle 9")
.Fill
.ForeColor
.RGB = RGB(0, 0, 0)
End With

What is wrong?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Changing color of a shape

this is the code i got when i filled a rectangle pink:

ActiveSheet.Shapes("Rectangle 1").Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 45
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid


so it appears that yours should be:

With ActiveSheet.Shapes("Rectangle 9")
.Fill.ForeColor.RGB = RGB(0, 0, 0)
End With

hope that helps somewhat
:)
susan


On Aug 7, 3:17*pm, Mike wrote:
I have a rectangle in a spreadsheet, when I click on it I run a macro to do
some things and I want to change it's color. *I have the following code but
it does not work:

* * With ActiveSheet.Shapes("Rectangle 9")
* * * * .Fill
* * * * .ForeColor
* * * * .RGB = RGB(0, 0, 0)
* * End With

What is wrong?


Reply
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
changing a shape font to bold with VB Brettjg Excel Discussion (Misc queries) 3 February 2nd 09 09:55 AM
shape color dubo Excel Discussion (Misc queries) 0 April 14th 07 01:31 PM
Changing color of node in freeform shape jstansbury Excel Programming 0 August 2nd 06 03:53 PM
Legends - Changing the Shape of Paul Charts and Charting in Excel 2 January 4th 06 12:22 PM
VBA Help with changing shape color for selected shapes only Nimrod[_2_] Excel Programming 8 April 29th 05 01:38 PM


All times are GMT +1. The time now is 09:20 PM.

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"