Convert data from a table to a chart?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 30 years of data in monthly increments. The years are listed by rows
and the months are listed by columns. How can I get this into a line chart?
 
Select all the data you wnt to put into the chart including the headings and
then Insert>Chart and select the line chart option.
 
Jess,

Assume the first table starts in A1 and covers the
range A1:D8. The macro below will rearrange
the table into columns. From here you can
sort the data and then plot it as one line.


2001 2002 2003
Jan 1 5 9
Feb 2 6 10
Mar 3 7 11


Sub RearrangeData()
Dim Rng1 As Range, Rng2 As Range
Set Rng2 = Sheets("Sheet1").Range("C8")
For Each Rng1 In Range("B2:D4")
Rng2.Formula = "=" & Rng1.Address
Rng2.Offset(0, -1) = "=$A" & Rng1.Row
Rng2.Offset(0, -2) = Range("A1").Offset(0, Rng1.Column - 1)
Set Rng2 = Rng2.Offset(1, 0)
Next Rng1
End Sub


Year Month Number
2001 Jan 1
2002 Jan 5
2003 Jan 9
2001 Feb 2
2002 Feb 6
2003 Feb 10
2001 Mar 3
2002 Mar 7
2003 Mar 11
 
Back
Top