something like this:
Sub Macro6()
lrA = Cells(Rows.Count, "A").End(xlUp).Row
lrC = Cells(Rows.Count, "C").End(xlUp).Row
lr = Application.Max(lrA, lrC) 'or Min? I expect the x and y have to have the smae number of values?
Application.Run "ATPVBAEN.XLAM!Regress", ActiveSheet.Range("C1:C" & lr), ActiveSheet.Range("A1:A" & lr), False, True, 95, ActiveSheet.Range("M1"), False, False, False, False, ActiveSheet.Range("X3"), False
End Sub
Arguments (not authoritative):
inpyrng As Variant, Input Y Range
Optional inpxrng As Variant, Input X Range
Optional constant As Variant, Constant is Zero true/false
Optional labels As Variant, Labels true/false
Optional confid As Variant, Confidence Level blank/nothing or 95 for 95%
Optional soutrng As Variant, Output Range "" for a new worksheet letting excel name the sheet, "a new sheet" quote the name of the new sheet, nothing for a new workbook
Optional residuals As Variant, Residuals true/false
Optional sresiduals As Variant, Standardized Residuals true/false
Optional rplots As Variant, Residual Plots true/false
Optional lplots As Variant, Line Fit Plots true/false
Optional routrng As Variant, ?? nothing
Optional nplots As Variant, Normal Probability Plots true/false
Optional poutrng As Variant ?? nothing
I tried using named arguments like inpyrng:= but it wasn't having it, so the arguments have to be in order
If you set a reference to atpvbaen.xls you can use the likes of:
Regress ActiveSheet.Range("$C$1:$C$14"), ActiveSheet.Range("$A$1:$A$14"), True, True, 95, ActiveSheet.Range("$M$1"), True, True, True, True, , True