Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Scatter chart data point colors (XL 97+)

    I have a scatter chart that summarizes LOTS of information. Basically I would like data points to be
    colored according to the initials of the person who entered the data (this is another column).
    Is this possible?

    Thanx

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scatter chart data point colors (XL 97+)

    either you organize your data per person and make different series per person, or you use a macro to do this.
    e.g. assume DLRange is the Range containing the DataLabels and INRange is the Range containing the initials, then the following code could be part of your macro:

    <pre>Set Sseries = ActiveChart.SeriesCollection(1)
    Sseries.HasDataLabels = True
    Set Pts = Sseries.Points
    For Each Pt In Pts
    i = i + 1
    Pt.DataLabel.Text = "=" & DLRange.Cells(i).Address _
    (rowabsolute:=True, columnabsolute:=True, _
    ReferenceStyle:=xlR1C1, external:=True)
    'here you add an if or case select statement to allow for different colors
    'depending on the initials
    Pt.DataLabel.Font.Bold = True
    if INRange.cells(i).value = "HP then
    Pt.DataLabel.Font.Color = vbRed
    else
    Pt.DataLabel.Font.Color = vbBlue
    end if
    Pt.DataLabel.Position = LabelPosition
    Next Pt
    </pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •