Hi,
i wonder how I can case for ex. x twice? Right not I have the script:
For example I want to:![]()
Please Login or Register to view this content.
Thnx in advance!![]()
Please Login or Register to view this content.
Hi,
i wonder how I can case for ex. x twice? Right not I have the script:
For example I want to:![]()
Please Login or Register to view this content.
Thnx in advance!![]()
Please Login or Register to view this content.
NameX cannot really have two different values in it unless you declare the function as an array and fill/Redim the array as you add each element into the array. If you haven't worked out dealing with arrays, it's major step up in coding.
Perhaps this a red herring. What's this function really for? You may need to revamp this whole process you're developing to keep it simple.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Hmm.. I have working with arrays (little bit) but I thought I could solve it much more simple. In C# you can use Break statement to solve it. Dunno how to do it in VBA. Can you give me an example on an nice array to use in this case?
Bts, hos does your Commercial Services work? What kind of support will I get if I pay for the CS? Everything need to be posted in the Forum or is it PMs?
Thnx!
What is the purpose of the function?
Do you want to return 2 values based on the argument Ex passed to the function?
PS I don't see how Break would solve this, all it does is terminate a loop or switch.
If posting code please use code tags, see here.
You could do it like this, which will return an array with the 2 names based on Ex.
![]()
Please Login or Register to view this content.
Use Code-Tags for showing your code: [code] Your Code here [/code]
Please mark your question Solved if there has been offered a solution that works fine for you
Get your feet wet here, then:
http://www.cpearson.com/excel/return...ysfromvba.aspx
I think the last macro example on that page may be the way you address two different values from the functions array results.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks