Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2017, 07:41 AM
SerenityNetworks SerenityNetworks is offline Worksheet function returns "Invalid or Unqualified Reference" Windows 10 Worksheet function returns "Invalid or Unqualified Reference" Office 2016
Advanced Beginner
Worksheet function returns "Invalid or Unqualified Reference"
 
Join Date: May 2005
Location: Allen, Texas, USA
Posts: 33
SerenityNetworks
Question Worksheet function returns "Invalid or Unqualified Reference"

I'm trying to use the BINOMDIST function in a UDF. I'm at a loss as to why it won't calculate. If I enter the formula =BINOMDIST(3,551,0.01,TRUE) in a worksheet then it correctly returns 0.199. When I try to use the same in a UDF it doesn't work. What am I doing wrong?

Thanks,
Andrew



Code:
Sub TestIt()
    Dim cdf As Double
    cdf = .BinomDist(3, 551, 0.01, True)
    Debug.Print cdf
End Sub
Reply With Quote
  #2  
Old 10-27-2017, 07:50 AM
NoSparks NoSparks is offline Worksheet function returns "Invalid or Unqualified Reference" Windows 7 64bit Worksheet function returns "Invalid or Unqualified Reference" Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 779
NoSparks has a spectacular aura aboutNoSparks has a spectacular aura aboutNoSparks has a spectacular aura about
Default

maybe

cdf = application.worksheetfunction.binomdist(3, 551, 0.01, True)
Reply With Quote
  #3  
Old 10-27-2017, 08:00 AM
SerenityNetworks SerenityNetworks is offline Worksheet function returns "Invalid or Unqualified Reference" Windows 10 Worksheet function returns "Invalid or Unqualified Reference" Office 2016
Advanced Beginner
Worksheet function returns "Invalid or Unqualified Reference"
 
Join Date: May 2005
Location: Allen, Texas, USA
Posts: 33
SerenityNetworks
Default

Thank you. That was it. I had tried cdf = .worksheetfunction.binomdist(3, 551, 0.01, True) , but that didn't do it. However, I just found leaving the dot off before worksheetfunction works okay. Much appreciated.
Reply With Quote
Reply

Tags
binomdist, macro, udf

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet function returns "Invalid or Unqualified Reference" Bibiography citation gets "Invalid source specified" error Jennifer Murphy Word 9 03-26-2017 11:21 PM
PPT for Mac: The value "#" is invalid. Please Provide a valid value. dshmed PowerPoint 0 11-23-2016 11:25 AM
How to use a "Save As" button without causing digital signatures to become "Invalid"? jferg Word VBA 0 02-16-2016 03:04 PM
Worksheet function returns "Invalid or Unqualified Reference" Making cross-reference say "Fig." instead of "Figure" dgalb Word 17 11-09-2014 06:25 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 09:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft