Applying Colours

S

Sanjay

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!
 
P

Peter T

Add 7 to the colorindex to set the same schemecolor.

eg
..SchemeColor = SelectedColour + 7

Regards,
Peter T
 
G

Guest

Sanjay:

Try replacing

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

with

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

Sanjay

Thanks Peter that's great !

Regards,

Peter T said:
Add 7 to the colorindex to set the same schemecolor.

eg
.SchemeColor = SelectedColour + 7

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top