View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Shi Shi is offline
external usenet poster
 
Posts: 13
Default VBA help on one of Jon Peltier's Charting

Mark,

I just went to your site, I did see any of your examples
relevant to the problem what I described here.

Here is the original data you may use it to test the
Charting macro:

Date,Open,High,Low,Close
6-Jul-04,28.32,28.33,27.94,28.02
2-Jul-04,28.62,28.68,28.4,28.57
1-Jul-04,28.7,28.84,28.26,28.63
30-Jun-04,28.57,28.8,28.39,28.56
29-Jun-04,28.18,28.58,28.18,28.5
28-Jun-04,28.6,28.75,28.17,28.28
25-Jun-04,28.48,28.63,28.25,28.57
24-Jun-04,28.48,28.65,28.36,28.39
23-Jun-04,28.2,28.38,28,28.3
22-Jun-04,28.15,28.35,27.81,28.29
21-Jun-04,28.22,28.66,28.12,28.35
18-Jun-04,27.77,28.5,27.7,28.35
17-Jun-04,27.31,27.92,27.29,27.77
16-Jun-04,27.34,27.5,27.15,27.32
15-Jun-04,26.99,27.6,26.97,27.41
14-Jun-04,26.55,26.9,26.53,26.9
10-Jun-04,26.38,26.79,26.38,26.77
9-Jun-04,26.4,26.65,26.4,26.47
8-Jun-04,26.28,26.65,26.24,26.6


-----Original Message-----
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
.

.