Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Charting? | Charts and Charting in Excel | |||
charting add in | Charts and Charting in Excel | |||
Jon Peltier's code: can't delete initial series?? | Charts and Charting in Excel | |||
Charting help! | Charts and Charting in Excel | |||
Custom charting - Stacked charting with a line | Charts and Charting in Excel |