Skip to main content
Support is Offline
Today is our off day. We are taking some rest and will come back stronger tomorrow
Official support hours
Monday To Friday
From 09:00 To 17:30
  Sunday, 09 October 2022
  1 Replies
  4.5K Visits
0
Votes
Undo
I have data with 3 column. column 1 is series name, column 2 is x-value, column 3 is y-value. Data is XY scatter data. Should I merge column 1 to a single cell?

Can I plot this data on same chart so that I have multiple xy data series using Kutools?
Thanks! I have just purchased the software so am looking for assistance.
1 year ago
·
#3127
0
Votes
Undo
Hi there,

We've created a VBA code, please insert that in a module and check if that is what you need:
Sub KutoolsChart()
'
' CSH
'
Dim xRg As Range
Dim i As Integer
On Error Resume Next
Set xRg = Application.InputBox(prompt:="Please select Range", Title:="Kutools for Excel", Type:=8)
If TypeName(xRg) = "Nothing" Then Exit Sub
If xRg.Columns.Count <> 3 Then
MsgBox ("Reference is not Valid")
Exit Sub
End If
ActiveSheet.Shapes.AddChart2(240, xlXYScatter).Select

For i = 1 To xRg.Rows.Count
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(i).Name = xRg.Cells(i, 1).Value
ActiveChart.FullSeriesCollection(i).XValues = xRg.Cells(i, 2)
ActiveChart.FullSeriesCollection(i).Values = xRg.Cells(i, 3)
ActiveChart.FullSeriesCollection(i).ApplyDataLabels
ActiveChart.FullSeriesCollection(i).DataLabels.Select
ActiveChart.FullSeriesCollection(i).DataLabels.ShowValue = False
ActiveChart.FullSeriesCollection(i).HasLeaderLines = False
ActiveChart.FullSeriesCollection(i).DataLabels.ShowSeriesName = True
Next
End Sub

After you copy and paste the code above, press F5 to run the code. And a dialog box will pop up asking you to select the three columns.

If you have any questions, please don't hesitate to ask me.

Amanda
  • Page :
  • 1
There are no replies made for this post yet.