G
GolfMan
I need a macro. if not is it possible to add it to a hidden sheet
Sub Graph()
ActiveSheet.Shapes.AddChart.Select
With ActiveChart
With .Parent
.Top = Range("d3").Top
.Left = Range("d3").Left
.Width = Range("d3:d16").Width
.Height = Range("d3:d16").Height
.Name = "Chart"
End With
.Axes(xlCategory).TickMarkSpacing = 25
.Axes(xlCategory).TickLabels.NumberFormat = "0.00"
.Legend.Delete
.ChartType = xlLine
.SeriesCollection(1).Values = "=Sheet2!b2:b" & lastrow
.SeriesCollection(1).XValues = "='Sheet2'!a2:a" & lastrow
End With
End Sub
Sub Graph()
ActiveSheet.Shapes.AddChart.Select
With ActiveChart
With .Parent
.Top = Range("d3").Top
.Left = Range("d3").Left
.Width = Range("d3:d16").Width
.Height = Range("d3:d16").Height
.Name = "Chart"
End With
.Axes(xlCategory).TickMarkSpacing = 25
.Axes(xlCategory).TickLabels.NumberFormat = "0.00"
.Legend.Delete
.ChartType = xlLine
.SeriesCollection(1).Values = "=Sheet2!b2:b" & lastrow
.SeriesCollection(1).XValues = "='Sheet2'!a2:a" & lastrow
End With
End Sub