Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Applying Colours

Hi,

I have selected a colour from a cell and would like to use that colour for a
shape, however the colour is not the same- am I applying the colour in the
wrong format?


Retrieving the colour via:

SelectedColour = Range("Time_Colour").Interior.ColorIndex

And applying the color via:

Selection.ShapeRange.Fill.ForeColor.SchemeColor =
SelectedColour
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.ForeColor.SchemeColor =
SelectedColour
Selection.ShapeRange.Line.Visible = msoTrue

Thanks!



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Applying Colours

Add 7 to the colorindex to set the same schemecolor.

eg
..SchemeColor = SelectedColour + 7

Regards,
Peter T

"Sanjay" wrote in message
...
Hi,

I have selected a colour from a cell and would like to use that colour for

a
shape, however the colour is not the same- am I applying the colour in the
wrong format?


Retrieving the colour via:

SelectedColour = Range("Time_Colour").Interior.ColorIndex

And applying the color via:

Selection.ShapeRange.Fill.ForeColor.SchemeColor =
SelectedColour
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.ForeColor.SchemeColor =
SelectedColour
Selection.ShapeRange.Line.Visible = msoTrue

Thanks!





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Applying Colours

Sanjay:

Try replacing

SelectedColour = Range("Time_Colour").Interior.ColorIndex

with

SelectedColour = Range("Time_Colour").Interior.Color

--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"Sanjay" wrote:

Hi,

I have selected a colour from a cell and would like to use that colour for a
shape, however the colour is not the same- am I applying the colour in the
wrong format?


Retrieving the colour via:

SelectedColour = Range("Time_Colour").Interior.ColorIndex

And applying the color via:

Selection.ShapeRange.Fill.ForeColor.SchemeColor =
SelectedColour
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.ForeColor.SchemeColor =
SelectedColour
Selection.ShapeRange.Line.Visible = msoTrue

Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Applying Colours

Thanks Peter that's great !

Regards,

"Peter T" <peter_t@discussions wrote in message
...
Add 7 to the colorindex to set the same schemecolor.

eg
.SchemeColor = SelectedColour + 7

Regards,
Peter T

"Sanjay" wrote in message
...
Hi,

I have selected a colour from a cell and would like to use that colour
for

a
shape, however the colour is not the same- am I applying the colour in
the
wrong format?


Retrieving the colour via:

SelectedColour = Range("Time_Colour").Interior.ColorIndex

And applying the color via:

Selection.ShapeRange.Fill.ForeColor.SchemeColor =
SelectedColour
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.ForeColor.SchemeColor =
SelectedColour
Selection.ShapeRange.Line.Visible = msoTrue

Thanks!







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
How can I customise colours used in charts and keep those colours. LJ Charts and Charting in Excel 3 May 20th 10 01:50 PM
How to save one of the MORE COLOURS in the THEME COLOURS? Wulfy Excel Discussion (Misc queries) 0 August 18th 09 10:25 AM
Applying functions to colours kippers Excel Discussion (Misc queries) 2 May 9th 07 09:03 PM
Excel 2003 font colours and cell colours bretta Excel Discussion (Misc queries) 1 April 17th 05 03:45 AM
Applying formulae ali Excel Programming 8 December 14th 03 01:46 AM


All times are GMT +1. The time now is 06:21 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"