Re: help with looping through array required!




"Norman Fritag" <muenchr@xxxxxxxxxxxxxx> wrote in message
news:44075dac$0$21881$5a62ac22@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Anthony,
yes this is a follow-up question on what was posted on 22 Feb!
The suggestion provided where not giving me a solution, although it
inspirited me to think further.
I found a solution in the meantime. The code may me shocking but it works.
I
have been able to modify the code to run faster as well, but arrays are
not
my strength.
Yes, I appreciate what this group had offered and thank everyone for there
input!

Regards

Norman


Hi Norman
I am sorry to hear you could not get my suggestion to work, but would be
interested to see if you really do have a working alternative - especially
if you have managed to get the code to run faster.
The original challenge was to find which combinations picked from a choice
of 20 numbers would sum together to make 275. Given that:

strSeries = "10,2,4,17,24,5,30,40,50," & _
"100,23,35,200,3501,201," & _
"245,323,2000,33,44"
I found 103 matches in 5.89 seconds.

And if I bothered to sort this list first - putting the largest number
first:

strSeries = "3501,2000,323,245,201," & _
"200,100,50,44,40,35,33," & _
"30,24,23,17,10,5,4,2"
I could dramatically reduce the time to 103 matches in 1.72 seconds

Please would you show us:
How many matches you find in what time
A list of them, eg:
275 = 201 + 44 + 30
275 = 245 + 30
275 = 200 + 40 + 35
And the code you used.


I may be able to look at the latest question some time tomorrow, but because
you have included so many lines of code some of which is to do with the
splitting and some of which covers the creating of new records, it is hard
to see exactly the bit you are having trouble with. Ideally the question
would focus on a very specific point.
As to the bit about posting to multiple newsgroups, the point is you should
(if you have to) cross-post rather than multi-post. If you cross-post,
everyone can see what is happening and who is providing answers - but if you
multi-post, you are effectively asking separate groups of people to
independently work on the problem without them knowing their efforts are
being duplicated in other newsgroups (we are all real people with real jobs,
wives, kids, household chores, etc to fit in around the newsgroups!)


.



Relevant Pages

  • Re: Office XP Sucks ass...
    ... >>misuse of Suggestion type posts. ... > suggestions to different newsgroups or nonnewsgroup forums. ... Suggestion post is selected. ... Microsoft is aware of this aspect. ...
    (microsoft.public.office.misc)
  • Re: Please, Microsoft, donīt use reverse notation in Help!
    ... for Microsoft using the web interface for the newsgroups on the MS ... The "Suggestion Wizard", which directs users to the newsgroups, has ... NNTP users along with a link you can use to vote on the posted ...
    (microsoft.public.office.misc)
  • Re: Wacom Tablet Tutorials
    ... [SNIP] ... a suggestion or two about newsgroups. ... >If you'd specified the personal experience part and stated that you'd ...
    (alt.graphics.photoshop)
  • Re: Word should have a checkbox for showing header and footer tools op
    ... Your post is way off-topic for this group and for newsgroups in general. ... > word as it is very annoying to go to view and clicking header and footer ... > This post is a suggestion for Microsoft, ... To vote for this suggestion, ...
    (microsoft.public.word.vba.general)
  • Re: delete rows where a cell is blank in specific column
    ... Using the little arrows on the top row, ... adding on a little to Andy's suggestion above... ... You've got a response in your multi-post ...
    (microsoft.public.excel)