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

I am trying to set the color on a shape object to the same color as the
border color for a series object. I want to execute a statement akin to:

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.ColorIndex

I know the above code fails but how can I translate the Border.ColorIndex to
an identical color permitting setting of SchemeColor? Any help appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Color problem

Have you tried

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.Color

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ojv" wrote in message
...
I am trying to set the color on a shape object to the same color as the
border color for a series object. I want to execute a statement akin to:

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.ColorIndex

I know the above code fails but how can I translate the Border.ColorIndex

to
an identical color permitting setting of SchemeColor? Any help

appreciated.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Color problem

Yes. It results in an out of range error.

"Bob Phillips" wrote:

Have you tried

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.Color

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ojv" wrote in message
...
I am trying to set the color on a shape object to the same color as the
border color for a series object. I want to execute a statement akin to:

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.ColorIndex

I know the above code fails but how can I translate the Border.ColorIndex

to
an identical color permitting setting of SchemeColor? Any help

appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Color problem

Following worked for me. With a line (shape) embedded on a chart and
selected:

Sub test()
Dim shLI As ShapeRange, cx as long, i

Set shLI = Selection.ShapeRange

i = 1 ' guess "i" is in a loop

cx = ActiveChart.SeriesCollection(i).Border.ColorIndex

If cx = xlAutomatic Then cx = i + 24

shLI.Line.ForeColor.SchemeColor = cx + 7
End Sub

Unless otherwise formated, coloured series lines will be xlautomatic, with
colours same as those from colorindex 25 and on, in series index order. Add
7 to convert to schemcolor.

Regards,
Peter T

"ojv" wrote in message
...
Yes. It results in an out of range error.

"Bob Phillips" wrote:

Have you tried

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.Color

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ojv" wrote in message
...
I am trying to set the color on a shape object to the same color as

the
border color for a series object. I want to execute a statement akin

to:

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.ColorIndex

I know the above code fails but how can I translate the

Border.ColorIndex
to
an identical color permitting setting of SchemeColor? Any help

appreciated.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Color problem

Solves it. Thx.

"Peter T" wrote:

Following worked for me. With a line (shape) embedded on a chart and
selected:

Sub test()
Dim shLI As ShapeRange, cx as long, i

Set shLI = Selection.ShapeRange

i = 1 ' guess "i" is in a loop

cx = ActiveChart.SeriesCollection(i).Border.ColorIndex

If cx = xlAutomatic Then cx = i + 24

shLI.Line.ForeColor.SchemeColor = cx + 7
End Sub

Unless otherwise formated, coloured series lines will be xlautomatic, with
colours same as those from colorindex 25 and on, in series index order. Add
7 to convert to schemcolor.

Regards,
Peter T

"ojv" wrote in message
...
Yes. It results in an out of range error.

"Bob Phillips" wrote:

Have you tried

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.Color

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ojv" wrote in message
...
I am trying to set the color on a shape object to the same color as

the
border color for a series object. I want to execute a statement akin

to:

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.ColorIndex

I know the above code fails but how can I translate the

Border.ColorIndex
to
an identical color permitting setting of SchemeColor? Any help
appreciated.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Color problem

Glad it works, should have mentioned that the relationship between series
index and colorindex 25 on only works in a "typical" chart, several factors
could upset this. If necessary apply the Color (not colorindex) as some cell
color format, the applied colour will be mapped to the nearest colorindex,
then return and apply that colorindex to your line (+7).

Regards,
Peter T

"ojv" wrote in message
...
Solves it. Thx.

"Peter T" wrote:

Following worked for me. With a line (shape) embedded on a chart and
selected:

Sub test()
Dim shLI As ShapeRange, cx as long, i

Set shLI = Selection.ShapeRange

i = 1 ' guess "i" is in a loop

cx = ActiveChart.SeriesCollection(i).Border.ColorIndex

If cx = xlAutomatic Then cx = i + 24

shLI.Line.ForeColor.SchemeColor = cx + 7
End Sub

Unless otherwise formated, coloured series lines will be xlautomatic,

with
colours same as those from colorindex 25 and on, in series index order.

Add
7 to convert to schemcolor.

Regards,
Peter T

"ojv" wrote in message
...
Yes. It results in an out of range error.

"Bob Phillips" wrote:

Have you tried

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.Color

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ojv" wrote in message
...
I am trying to set the color on a shape object to the same color

as
the
border color for a series object. I want to execute a statement

akin
to:

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.ColorIndex

I know the above code fails but how can I translate the

Border.ColorIndex
to
an identical color permitting setting of SchemeColor? Any help
appreciated.








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Color problem

Thx. again. Will keep in mind. Some times the way colors work out in Excel do
not appear entirely logical, at least to me.

ojv

"Peter T" wrote:

Glad it works, should have mentioned that the relationship between series
index and colorindex 25 on only works in a "typical" chart, several factors
could upset this. If necessary apply the Color (not colorindex) as some cell
color format, the applied colour will be mapped to the nearest colorindex,
then return and apply that colorindex to your line (+7).

Regards,
Peter T

"ojv" wrote in message
...
Solves it. Thx.

"Peter T" wrote:

Following worked for me. With a line (shape) embedded on a chart and
selected:

Sub test()
Dim shLI As ShapeRange, cx as long, i

Set shLI = Selection.ShapeRange

i = 1 ' guess "i" is in a loop

cx = ActiveChart.SeriesCollection(i).Border.ColorIndex

If cx = xlAutomatic Then cx = i + 24

shLI.Line.ForeColor.SchemeColor = cx + 7
End Sub

Unless otherwise formated, coloured series lines will be xlautomatic,

with
colours same as those from colorindex 25 and on, in series index order.

Add
7 to convert to schemcolor.

Regards,
Peter T

"ojv" wrote in message
...
Yes. It results in an out of range error.

"Bob Phillips" wrote:

Have you tried

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.Color

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ojv" wrote in message
...
I am trying to set the color on a shape object to the same color

as
the
border color for a series object. I want to execute a statement

akin
to:

shLI.Line.ForeColor.SchemeColor =
ActiveChart.SeriesCollection(i).Border.ColorIndex

I know the above code fails but how can I translate the
Border.ColorIndex
to
an identical color permitting setting of SchemeColor? Any help
appreciated.









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
Tab color problem Shari Excel Discussion (Misc queries) 5 March 7th 08 03:26 PM
Problem displaying color mgossard Excel Discussion (Misc queries) 0 February 9th 08 05:15 PM
Background color problem Doug Sanders Excel Discussion (Misc queries) 3 February 10th 06 06:29 AM
A different "Fill Color" problem JKD Excel Worksheet Functions 1 November 1st 04 10:21 PM
vlookup color problem bob Excel Programming 1 August 14th 03 04:01 AM


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