View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Tom Ogilvy - Need a little change

For i = 1 To tot
If v2a(i, 3) < lMax And v2a(i, 3) < lMax - 1 Then
v2a(i, 1) = Empty
Else
If v2a(i, 2) = 1 Then
cnt = cnt + 1
End If
End If
Next
ReDim v3a(1 To cnt, 1 To 11)
cnt = 0

becomes

For i = 1 To tot
If v2a(i, 2) = 1 Then
cnt = cnt + 1
End If
Next
ReDim v3a(1 To cnt, 1 To 11)
cnt = 0


now change
If bPrintout Then
Worksheets.Add After:=Worksheets(Worksheets.Count)
Set sh = ActiveSheet
sh.Range("A1").Resize(cnt, 11).Value = v3a
End If


to printout as you wish.

--
Regards,
Tom Ogilvy




"Maxi" wrote in message
oups.com...
Thanks Tom,

Possibily the result I posted may be wrong and I see there is only
slight difference. Your result must be the appropriate one.

Few more doubts that I need to clarify:

The new data I provided was creating overall 10413 combinations out of
which 1001 unique combinations were repeated 4x and 1 unique
combination was repeating 1x = 1002 combinations on which you ran the
new SUPPORTING VALUE code to find out supporting value for each
combination.

I have one more requirement where instead of analyzing only 1002
combinations, I want to analyze all 4405 unique combinations (1001 =
4x, 1 = 3x, 3003 = 2x and 400 = 1x). I got these 4405 combinations
which are unique from the total 10413 combinations after eliminating
all duplicates. After doing this, run the SUPPORTING VALUE routine on
these 4405 combinations.

This is what I tried:
Instead of : If v2a(i, 3) < lMax And v2a(i, 3) < lMax - 1 Then
I tried : If v2a(i, 3) < 1 Then

Is this correct? Or will it require few other changes?

Also 4405 can easily fit into a worksheet but on a real data if the
worksheet overflows, I want to list only the top 65536 combinations
sorted on SUPPORTING VALUE descending.

Thanks
Maxi

Tom Ogilvy wrote:
My results vary slightly from what you have posted, but I have verified
mine
using formulas, and they appear to be correct.