Hi,
(2) As there are usually several such points that should be marked, the
following procedure appered many times invaluable:
Sub MarkerColor()
'(e-mail address removed)
'Sub changes the colors of individual markers in the selected series
'of x-y chart into the colors of the fonts of parent cell v a l u e s.
'It keeps the marker interior the way as defined for the whole series:
'either empty, or of uniform color. If, however, the background
'of any value cell is light gray, the interior of corresponding
'marker changes into its opposite, i.e. if the series has been declared
'as marker full then such a marker turns to empty and vice versa.
'If the cell background is medium gray, the marker optically disappears.
'The aim is to identify individual markers or their groups within
'one complete series on an x-y chart without having to decompose
'the parent range into subranges.
Dim SP As Points, W As Range
Dim ErrMsg As String, SPF As String, Rng As String
Dim I As Long, N As Long, PosComma As Long, ICI As Long, FCI As Long
Dim MarkersAreEmpty As Boolean
Const Comma = ",", LightGray = 15, MediumGray = 48
ErrMsg = "No series has been selected"
On Error GoTo ErrExit
Set SP = Selection.Points
MarkersAreEmpty = Selection.MarkerBackgroundColorIndex = xlNone
N = SP.Count
SPF = SP.Parent.Formula
I = 3
Do
I = I + 1
Rng$ = Right(SPF, I)
Loop Until Left(Rng, 1) = "!"
Rng = Right(Rng, Len(Rng) - 1)
PosComma = Application.WorksheetFunction.Search(Comma, Rng)
Rng = Left(Rng, PosComma - 1)
Set W = Range(Rng)
For I = 1 To N
FCI = W.Cells(I).Font.ColorIndex
On Error GoTo Skip
SP(I).MarkerForegroundColorIndex = FCI
ICI = W.Cells(I).Interior.ColorIndex
If ICI = LightGray Then
If MarkersAreEmpty Then
SP(I).MarkerBackgroundColorIndex = FCI
Else
SP(I).MarkerBackgroundColorIndex = xlNone
End If
ElseIf ICI = MediumGray Then
SP(I).MarkerForegroundColorIndex = xlNone
SP(I).MarkerBackgroundColorIndex = xlNone
Else
If Not MarkersAreEmpty Then
SP(I).MarkerBackgroundColorIndex = FCI
Else
SP(I).MarkerBackgroundColorIndex = xlNone
End If
End If
Skip:
Next I
Resume Next
Exit Sub
ErrExit:
MsgBox ErrMsg$
On Error GoTo 0
End Sub
Regards