Scatter graph learning curve.
Hello all. I am trying a simple method of creating a scatter graph using the code below. This is using the macro recording but eventually I would like to apply this to capture data on multiple sheets and creating multiple graphs on the same page, but for now this is to get a better understanding.
I would like to create a scatter graph where the range in each column can either finish at lets say A30 or A45 as the data set can change...how would I capture the 'unknown range in each column...e.g..
<tbody>
</tbody>
The code I have below:
Not sure if that makes sense but the code above does not work.
Basically I would like something dynamic as the range of data will be unknown. The range of data will have to be ( Data/X) and ( Data /Y )..
Am I going in the right direction? Please may someone help.
Hello all. I am trying a simple method of creating a scatter graph using the code below. This is using the macro recording but eventually I would like to apply this to capture data on multiple sheets and creating multiple graphs on the same page, but for now this is to get a better understanding.
I would like to create a scatter graph where the range in each column can either finish at lets say A30 or A45 as the data set can change...how would I capture the 'unknown range in each column...e.g..
Data | X | Y |
11 | 15 | 132 |
154 | 158 | 4 |
1254 | 458 | 8883 |
45 | 8 | 4863 |
454 | 45848 | 453 |
4882 | 45 | 448 |
8564 | 75 | 458 |
5888 | 15 | 487 |
878 | 49 | 69 |
689 | 987 | 65 |
<tbody>
</tbody>
The code I have below:
HTML:
Sub CommandButton_Click()
With ActiveSheet.ChartObjects.Add(Left:=100,Width:=375,Top:=75, Height:=225)
.chart.SetSourceData Source:=Sheets("Sheets2").range("A2:A10").range("B2:B10")
.chart.ChartType = xlXYScatterLines
End With
End Sub
Not sure if that makes sense but the code above does not work.
Basically I would like something dynamic as the range of data will be unknown. The range of data will have to be ( Data/X) and ( Data /Y )..
Am I going in the right direction? Please may someone help.