Hello,
I am trying to make a macro in excel that makes graphs from a variable range. This is what I have so far and I don't know why it does work.
Sub Macro1()
'
' Macro1 Macro
'
'
Range("A5").Select
Range(Selection, Selection.End(xlDown)).Select
n = Range("A5", Range("A5").End(xlDown)).Count
Range("D5").Activate
f = Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range(n, f) 'it fails here
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
End Sub
I've tried many different things and I don't know how to put in a range that will select to the last non empty cell in a column.
Thank you so much for your help.
Configuration: Windows XP Firefox 3.0.11 excel 2007