Novice: Automating Simple Linear Regression with a Button?

Travis_C

New Member
Joined
Sep 6, 2006
Messages
1
Hi guys,

I've got a simple regression automation problem that's got me stumped.

I'll try and spell out the problem as explicitly as I can:


Idea is to automate the following process with a button:
-Run simple Analysis Toolpak Regression function one set of paired datapoints
-Have result outputted to separate sheet ("Correlation_Outputs")

Here's what I've done:
-Data is organized in columns on one sheet ("Data_Arrange")
-Button & r-squared output to be displayed on another sheet ("INPUTS")
-Button created using simple button tool
-Macro recorded using basic macro tool, resulting in following VBA code:

"
Sub Regression_Test()
'
' Regression_Test Macro
' Macro recorded 06/09/2006 by
'

'
Sheets("Data_Arrange").Select
Application.Run "ATPVBAEN.XLA!Regress", ActiveSheet.Range("$D$4:$D$39"), _
ActiveSheet.Range("$C$4:$C$39"), False, True, , ActiveSheet.Range("$A$1") _
, False, False, False, False, , False
Sheets("INPUT").Select

End Sub
"

-Macro was assigned to new button
-Button was clicked, resulting in following error:

"
Run-time error '1004':
The macro " cannot be found.
"

I am running Excel 2003 SP2 edition at work on my employer's Window's NT network.

I understand this silly question has probably been posted numerous times, but after searching through the forum (and the Excel online help) I had no luck finding a solution.

Any help you guys (and gals) can offer would be of huge benefit...

Thanks so much!!!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I can only guess. the solutions may be trivial but mistake can happen anywhere. My aplogies
first check the spelling of the macro name the button-click code.
better to copy the macro name and paste it under the buttonclick
If you have taken the button from the forms toolbar. it is ok. and you assinged the macaro from the list of macros. It shuld be ok

once agan check whethr the main macro works by step debugging-successively hitting F8.
 
Upvote 0

Forum statistics

Threads
1,214,659
Messages
6,120,786
Members
448,994
Latest member
rohitsomani

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
Back
Top