Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB function that accepts an array of unknown length

Posted on 2014-03-28
5
Medium Priority
?
203 Views
Last Modified: 2014-03-28
Would like a sample function that takes as its argument any array (one or two dimensions) and then gets its length (or if its two dimensional its length in both directions).  Then allows me to do some sort of calculation on it and return that value (e.g. average, sum, max min).
0
Comment
Question by:dma70
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
ste5an earned 1600 total points
ID: 39961720
0
 
LVL 1

Author Closing Comment

by:dma70
ID: 39961735
Thank you that is very useful.   What did you use to find this?
0
 
LVL 1

Author Comment

by:dma70
ID: 39961847
ste5an:   I just tried one of the functions listed.  Do you know why the following gives me an error?:

IsArrayAllocated
0
 
LVL 35

Expert Comment

by:ste5an
ID: 39962084
0
 
LVL 1

Author Comment

by:dma70
ID: 39962112
thanks -- I was able to get the function to compile when I added the huge number of functions your textbook referred to.   But the program still fails on the Array Allocation test.

Despite what you sent me - I think this is beyond my comprehension.    All I care about is that the function accepts any set of cell range as an input.   It doesn't at the moment until I understand more about what allocation means.    I am not sure why this needs to be so complicated.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question