Macro that produces output to specific sheet

AdiVohra

New Member
Joined
Aug 31, 2014
Messages
24
I have this macro to run a regression on data.

Sub Regression()
'
' Regression Macro
'


'
Application.DisplayAlerts = False
Sheets("Data").Select
Application.Run "ATPVBAEN.XLAM!Regress", ActiveSheet.Range("$B$3:$B$" & Range("B" & Rows.Count).End(xlUp).Row), _
ActiveSheet.Range("$E$3:$E$" & Range("E" & Rows.Count).End(xlUp).Row), False, True, , "Data", False, _
False, False, False, , False
Application.DisplayAlerts = True
End Sub

But how do I produce the output of the regression on to a specific sheet for instance called "results"? At the moment the regression produces the results on a new sheet everytime but this is not ideal.

Finally, I need a way that the macro picks up certain data from the regression results and pastes this into a final "history sheet". Everytime the macro is run the sheet keeps adding the results so it accumulates the outcome in a table of history? Any ideas

Thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,195,745
Messages
6,011,401
Members
441,613
Latest member
worksux

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top