LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.userforms
external usenet poster
 
Posts: 269
Default Passing Userform as an argument to a procedure

ParamArray, etc.cannot be used for the particular app

There was a long thread on this topic way back when.

Charles Williams and I took the discussion off line.

The proposed solution at
http://www.decisionmodels.com/downlo...AreasBugBypass works, but is not
appropriate for the general case, due to the requirement for Application
volatile.

I did find some MSFT KB articles that described other instances of this bug,
but dag nab it, I don't recall where I saved those articles.

--
http://www.standards.com/; See Howard Kaikow's web site.
"keepitcool" wrote in message
...
Howard,


Humbled.. not not defeated :)

The BugByPass is one UGLY *******. AND not needed when you dont pass named
ranges. There'a much simpler way around it.


Note the extra () around the argument in K2 and K3
If you try that with SUM function...
This will work:=SUM( Arrays!A1,RefSheet!A1 )
This will fail:=SUM((Arrays!A1,RefSheet!A1))

it'll warn you of illegal use, cause you use union before passing.
it to the sum formula :)

You should make your UDF use ParamArray (as Sum does internally)
Then all examples compute correctly with the exception of ROW 7
where a MultiArea NamedRange is passed.

Private Function ProcessParam(ParamArray vntArray())
Dim dblSumFunction As Double
Dim vntItem As Variant
Dim vntArea As Range

For Each vntItem In vntArray
dblSumFunction = dblSumFunction + Application.Sum(vntItem)
Next

ProcessParam = dblSumFunction
End Function




< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Howard Kaikow" wrote:

http://www.decisionmodels.com/downlo...AreasBugBypass




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a UDF as an argument to a UDF puff Excel Discussion (Misc queries) 3 February 23rd 06 09:46 PM
Passing properties to a procedure Matt McQueen[_2_] Excel Programming 1 July 30th 03 04:44 PM
Passing an argument to a quote Zach Excel Programming 1 July 25th 03 04:16 AM
Passing an argument to a quote Zach Excel Programming 1 July 25th 03 01:00 AM
Passing a Password to a VBA Procedure Orlando Magalhães Filho Excel Programming 0 July 9th 03 05:41 AM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"