B
Brian Elliott
If I have 2 rows of data, say, A1 to C1 and A2 to C2 and record a macro :-
Charts Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source := Sheets ( " Sheet1 " ).Range ( " A1 : C2
" ), plotby := xlrows
This works - I get 3 pairs of co-ordinates in a graph.
When I use the equivalent code in a VB6 program :-
Set ch = wbook1.Charts.Add
With ch
..ChartType = xlXYScatter
..ChartWizard Source := wsheet1.Range ( " A1 : C2 " ) , plotby := xlRows
End With
I get SIX separate points , 2 at x axis co-ordinate 1 , 2 more at x=2 etc.
I have tried xlColumns, leaving the plotby out etc. but I am missing
something very obvious I think.
Any suggestions please.
Charts Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source := Sheets ( " Sheet1 " ).Range ( " A1 : C2
" ), plotby := xlrows
This works - I get 3 pairs of co-ordinates in a graph.
When I use the equivalent code in a VB6 program :-
Set ch = wbook1.Charts.Add
With ch
..ChartType = xlXYScatter
..ChartWizard Source := wsheet1.Range ( " A1 : C2 " ) , plotby := xlRows
End With
I get SIX separate points , 2 at x axis co-ordinate 1 , 2 more at x=2 etc.
I have tried xlColumns, leaving the plotby out etc. but I am missing
something very obvious I think.
Any suggestions please.