简体   繁体   中英

I tried to run t-test in Excel using VBA, encountering “objects required” error

Sub ttest()
Application.Run (ATPVBAEN.XLAM!Pttestv), ActiveSheet.Range(Cells(ActiveCell.Row, ActiveCell.Column), Cells(5771, ActiveCell.Column)), ActiveSheet.Range("$BU$1", "$BU$5771"), ActiveSheet.Range(Cells(5785, ActiveCell.Column - 3), Cells(5797, ActiveCell.Column)), "", False, 0.05
End Sub

I am not very certain about the arguments in t-test in Excel. I assume the arguments are "Application.Run (ATPVBAEN.XLAM!Pttestv), Input range 1 , Input range 2 , output range ,.... "

However, I keep encountering "objects required" error. Could someone plz help me?

I just found the simple error in this code is that

Application.run (ATPVBAEN.XLAM!Pttestv)

should be

Application.run "ATPVBAEN.XLAM!Pttestv"

Sorry for bothering!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM