I have looked around the web for a while and tried different things, not worked. I have a set of data that will vary in length all in different sheet, I wrote a macro to put all of them in one sheet, now they all have different number of rows. I'm trying to put all of them onto a graph but I get stuck when specifying the range. All help would be kindly appreciated, bellow is the code that I manipulated from a recorded Macro:
Sub charttest()
Dim r As Range
Set r = ActiveSheet.Range("A1").CurrentRegion
Range("D9").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'OBA 1'!$A$1" & "r.Columns.Coun, r.Rows.Coun")
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
End Sub