View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mark E. Philpot[_2_] Mark E. Philpot[_2_] is offline
external usenet poster
 
Posts: 1
Default VBA help on one of Jon Peltier's Charting

I have created a chart maker. see it at
http://au.geocities.com/excelmarksway

If you would like to send some dummy info to me, with
requestinfo, maybe I can create a chartmaker for you.
I will require a real return email address
regards
Mark
-----Original Message-----
Jon's technique helps me a lot to plot a stock's HLC

chart
manually. But if I record it as a macro based on his
recommended steps, it doesn't work anymore. I have a
standard Data sheet, the
stock's "Date", "Open", "High", "Low" and "Close" data
located at "A, B, C, D, E" columns respectively.

The following "HLC20 macro" works fine, but "OpenLine
macro" doesn't. Can anyone find out what's the problem
with "OpenLine macro"? Thanks.

Sub HLC20()
Range("A1:A20,C1:E20").Select
Range("C1").Activate
Charts.Add
ActiveChart.ChartType = xlStockHLC
ActiveChart.SetSourceData Source:=Sheets("Data
Sheet").Range("A1:A20,C1:E20") _
, PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsNewSheet,
Name:="Chart1"
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType

=
xlCategoryScale
End Sub

Sub OpenLine()
Sheets("Data Sheet").Select
Range("A1:B20").Select
Selection.Copy
Sheets("Chart1").Select
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection.Paste Rowcol:=xlColumns,
SeriesLabels:=True, _
CategoryLabels:=True, Replace:=False,
NewSeries:=True
ActiveChart.SeriesCollection(4).Select
Application.CutCopyMode = False
ActiveChart.SeriesCollection(4).ChartType =
xlXYScatterSmooth
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(4).XValues = ""
ActiveChart.SeriesCollection(4).Select
ActiveChart.SeriesCollection(4).AxisGroup = 1
End Sub
.