descriptive statistics

Asche

Board Regular
Joined
Jun 25, 2008
Messages
50
want to make a macro to do a 'descriptive statistics data analysis' of column b and put the results in m1 to n18.
basically doing this but in a macro.
add in= tools /data analysis/ descriptive stats

I have recorded it doing this, but it for some reason can't do what it wrote.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Can you post the code? That might help us help you.
Cindy
I need the code that is what I am asking for.

Sub xlAddin() Dim objExcel As Excel.Application Set objExcel = CreateObject("Excel.Application") ' Opens the add-in, which is in the Analysis folder of the ' Excel Library Directory. objExcel.workbooks.Open (objExcel.Application.librarypath & _ "\Analysis\atpvbaen.xla") ' Runs the AutoOpen macro in the add-in objExcel.workbooks("atpvbaen.xla").RunAutoMacros (xlAutoOpen) MsgBox objExcel.Application.Run("atpvbaen.xla!lcm", 5, 2) objExcel.Quit Set objExcel = Nothing End Sub

that is what I am told I am looking............
 
Upvote 0
I recorded the actions Tools | Data Analysis | Descriptive Statistics, then chose my options, saved the macro, deleted the output just created, reran the recorded macro, and it worked fine. Here's the code that was recorded:
Code:
Sub Macro1()
     Application.Run "ATPVBAEN.XLA!Descr", ActiveSheet.Range("$B$3:$B$9"), ActiveSheet.Range("$M$1"), "C", False, True, 1, 1, 95
Do you have the analysis toolpak activated?
Maybe we're missing the point.
Cindy
 
Upvote 0
I recorded the actions Tools | Data Analysis | Descriptive Statistics, then chose my options, saved the macro, deleted the output just created, reran the recorded macro, and it worked fine. Here's the code that was recorded:
Code:
Sub Macro1()
     Application.Run "ATPVBAEN.XLA!Descr", ActiveSheet.Range("$B$3:$B$9"), ActiveSheet.Range("$M$1"), "C", False, True, 1, 1, 95
Do you have the analysis toolpak activated?
Maybe we're missing the point.
Cindy

not really sure, I know nothing really of excel I do know visual basic but not like this, I have win 2000 so if that helps. but let me try this then get back to you.

told me
'run time error 1004
atpvnane.xla could not be found. check the spelling of the file name and verify that the file located is correct.

if you are trying to open the file from your list of most recently used files on the file menu make sure that the file has not been renamed mover or deleted.'

'Application.Run "ATPVBAEN.XLA!Descr", ActiveSheet.Range("$B$1:$B$30"), _
'ActiveSheet.Range("$M$1:$N$18"), "C", False, True, 1, 1, 95

that is what my computer recorded
 
Upvote 0
In the Tools menu, click Add-Ins, and make sure that Analysis Tookpak - VBA has a check-mark. If you don't see it in the list, then there may be something non-standard in your installation. (I'm on Excel 2000 as well, so that's not the issue).
All I did to create the code was to start the macro recorder, then "click through" the steps to get the descriptive statistics that I wanted, and to put them in M1. (Note the data range will need to be modified to fit your data...I just grabbed a few cells from column B).
Hope this helps,
Cindy
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,228
Members
448,951
Latest member
jennlynn

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