spotword.blogg.se

Creating scatter plot in excel
Creating scatter plot in excel









creating scatter plot in excel

creating scatter plot in excel

Locate the Series name box with the cursor. Click on the Add button from the Select Data Source.

creating scatter plot in excel

Go to the design tab, under the data group click on the select data button. Whenever adding a chart via VBA it's a good practice to first delete any series which got auto-added. If you insert a chart sheet or chartobject while there's data selected on a worksheet, the chart will auto-plot the selected data. Axes(xlValue, xlPrimary).AxisTitle.Text = "Power (kW)" Axes(xlValue, xlPrimary).HasTitle = True Axes(xlCategory, xlPrimary).AxisTitle.Text = "Time (h)" Axes(xlCategory, xlPrimary).HasTitle = True SetElement (msoElementChartTitleAboveChart) ' If there is a previous chart, delete it Any ideas on whats causing this? Sub CreatingChartOnChartSheet()

#Creating scatter plot in excel code

Continuing to rerun my code repeats the cycle of good plot -> bad plot -> good plot. Then, when I run the code a third time, I get the correct plot once again. However, when I rerun the code with a "Power Chart" present, I get 3 additional series showing up, two with blank data and one with only y values, corresponding to the last column in my worksheet. when there is no "Power Chart" present), it plots the data correctly. When I run the code shown below for the first time (i.e. I am trying to create an xy scatter plot on its own worksheet using VBA.











Creating scatter plot in excel