Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Charting / July 2005

Tip: Looking for answers? Try searching our database.

referencing lines and series points

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
medicenpringles - 28 Jul 2005 17:47 GMT
what is the VBA code for referencing to individual points in a line on
line graph?  i would like to create a macro to change indiviual points
shapes and the color or the lines in between them to different color
depending on different parameters.  is this possible

--
medicenpringle
bj - 28 Jul 2005 21:58 GMT
Ther easiest way to do this is to first record a macro doing what you want.  
then you have to modify the macro so that the right data points will be
referenced.

It is hard to describe the code wtihout knowing what you want to do.

> what is the VBA code for referencing to individual points in a line on a
> line graph?  i would like to create a macro to change indiviual points'
> shapes and the color or the lines in between them to different colors
> depending on different parameters.  is this possible?
Andy Pope - 29 Jul 2005 00:00 GMT
Hi,

The Macro Recorder is useful for tasks like this. Giving you an insight
into the objects and properties needed.

Sub Macro2()
'
' change the line between points and 4 to red
'
    ActiveChart.SeriesCollection(1).Select
    ActiveChart.SeriesCollection(1).Points(4).Select
    With Selection.Border
        .ColorIndex = 3
        .Weight = xlThin
        .LineStyle = xlContinuous
    End With
'
' change marker to red circle black border size 10
'
    With Selection
        .MarkerBackgroundColorIndex = 3
        .MarkerForegroundColorIndex = 1
        .MarkerStyle = xlCircle
        .MarkerSize = 10
        .Shadow = False
    End With
    ActiveChart.PlotArea.Select
End Sub

Cheers
Andy

> what is the VBA code for referencing to individual points in a line on a
> line graph?  i would like to create a macro to change indiviual points'
> shapes and the color or the lines in between them to different colors
> depending on different parameters.  is this possible?

Signature

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.