Charts: Drawing lines
Charts: Drawing lines
(OP)
I am trying to draw lines on a chart generate by a vb program in Excel. Attempting to use the .shapes.addline but I am having problems with formating the code correctly. In the end I am not sure this is the result I am after because I am really trying to draw lines based on a specific value making up the x axis of the chart, i.e scale from 0 to 100, I want to draw a straight line across the chart at 50.





RE: Charts: Drawing lines
CODE
.MajorUnit = 50
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
Steam Engine enthusiasts
Steam Engine Prints
RE: Charts: Drawing lines
CODE
Set myline = Chart2.Shapes.AddLine(117.33, 57.36, 515.19, 229.43)
End Sub
Sub MacroSample2()
Set myline = Sheet1.ChartObjects("Chart 1").Chart.Shapes.AddLine(117.33, 57.36, 515.19, 229.43)
End Sub
use sample1 if the chart is embedded in a worksheet
RE: Charts: Drawing lines
RE: Charts: Drawing lines
RE: Charts: Drawing lines
RE: Charts: Drawing lines
CODE
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(3).XValues = "={1807,1807}"
ActiveChart.SeriesCollection(3).Values = "={-1000,1000}"
you may need to create a new series for each line. Good luck!
RE: Charts: Drawing lines
Any additional thoughts?
RE: Charts: Drawing lines