Hi,
I have the code below which runs a regression for me in Excel 2010. You will see that the DV range (X) is dynamic from AV27 down, so when the quantity of data changes it references it properly - this is fine. The same goes for the IV range (Y) but it is dynamic only in terms of the quantity of rows down - I need it to be dynamic in terms of the number of columns across too - at the moment it is fixed to column 'AZ'. How can the code be amended to reflect this?
Many thanks,
[h=1][/h]
I have the code below which runs a regression for me in Excel 2010. You will see that the DV range (X) is dynamic from AV27 down, so when the quantity of data changes it references it properly - this is fine. The same goes for the IV range (Y) but it is dynamic only in terms of the quantity of rows down - I need it to be dynamic in terms of the number of columns across too - at the moment it is fixed to column 'AZ'. How can the code be amended to reflect this?
Many thanks,
Code:
Application.Run "ATPVBAEN.XLAM!Regress", ActiveSheet.Range("$AV$27:$AV$" & Range("AV" & Rows.Count).End(xlUp).row), ActiveSheet.Range("$AW$27:$AZ$" & Range("AZ" & Rows.Count).End(xlUp).row), False, False, , _ ActiveSheet.Range("$BQ$57"), False, False, False, False, , False