How to Put Two Sets of Data on One Graph in Excel

Date Issue redmeption App Session Date Issue redmeption App Session
21-Nov 891 200 523 28-Nov 660 179 302
22-Nov 607 125 423 29-Nov 712 165 420
23-Nov 456 165 422 30-Nov 499 128 331
24-Nov 510 115 391 1-Dec 596 170 392
25-Nov 525 120 400 2-Dec 573 169 397
26-Nov 585 158 396 3-Dec 450 120 350
27-Nov 582 88 410 4-Dec 650 150 360
Participant Asked on December 3, 2016 in Excel: Charts.
Add Comment
1 Answer(s)

Dynamic chart

Original Data is in columns A thru H.

A table should be created with the same headers as the data.

The chart is dynamic because it comes from a table.

The macro assumes the data is in date order.


RE: How to Put Two Sets of Data on One Graph in Excel

Sub CombineDataChart()
Dim colA As Range
Dim colE As Range
Dim colJ As Range
Dim ra As Long
Dim re As Long
Dim rj As Long
Dim FinalRow As Range
Set colA = Range(“A:A”)
Set colE = Range(“E:E”)
Set colJ = Range(“J:J”)
ra = Application.WorksheetFunction.counta(colA)
re = Application.WorksheetFunction.counta(colE)
rj = Application.WorksheetFunction.counta(colJ)
Application.ScreenUpdating = False

If rj = 1 Then GoTo Line1
Range(“J2:M” & rj).ClearContents
ActiveSheet.ListObjects(“Table1”).Resize Range(“J1:M2”)
Set FinalRow = Cells(Rows.Count, 10).End(xlUp)
Range(“A2:D” & ra).Copy Destination:=FinalRow
Set FinalRow = Cells(Rows.Count, 10).End(xlUp)
Range(“E2:H” & re).Copy Destination:=FinalRow

End Sub

Expert Answered on February 5, 2018.
Add Comment
  • Found this useful?

    Please share using the share button above.

    If you found the answer is best answer for your question, Please mark as 'best answer' by clicking on the right tick mark icon at the left side of the answer.

    Found the answer useful and wants to credit the user, then vote the answer (vote up).

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.