Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arrays

Status
Not open for further replies.

Davidprince

Programmer
Jul 1, 2003
52
AU
Ladies and Gentlemen
I have an array of letters, after having set up data on an Excel spreadsheet. Copied the array into VBA as normal and have been able to count the number of times each letter occurs and display this on the spreadsheet. The data looks like this:
Letter a b c d e f g h i
e 1
d 1
h 1
d 2

This is a friends betting system, which I am hoping to prove is quite useless (my manual tests so far indicate it works...which can't be correct, so I am trying to automate it and want to run 10,000 or 20,000 samples).
Back to the data. When one group takes over (in the data d is now in front of e), he bets on that letter. When the group wins, he restarts. My problem is in the restarting and I have looked at passing the array to a function or a subroutine without success (very rusty on VB). I have also looked at looping, but would prefer the structure of passing the array as it is easier to follow (no doubt my friend will want to amend his ideas down the track).
Suggestions on reference material on passing arrays to subroutines and functions would also be helpful.
Cheers
David


 
Ladies and Gentlemen
Thanks for your responses. MajP, I am aware of the articles and several others on the web, but appreciate the input. Skip, spologies for not uploading the code. I need to reduce it down before doing so, as all my scribles are included. Hope to have that sorted by Thursday and will then upload the file.
Thanks
David
 
OK, I am a little confused. If you are aware of those reference materials, then you will have to be more specific about what part you do not understand. Those articles clearly show how to pass and return arrays.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top