Vb6 turn off screenupdating

I read through the posts in the 5 threads I found in the VB6 forum and they didn’t quite meet my needs in terms of the first part – the generation of the combinations.

If you remember the title of your thread and let me know, I will be glad to search for it.

generating the combinations; that the code would have each set of 6 numbers placed (each number) in a cell (e.g.

columns A to F) as I requested in my post #1 above.

On a close examination of the final code Milk suggested to you (his post #10), I observed that the code uses the term ‘ which is what you originally desired in your post #1 in that thread. As I indicated above, if it’s OK with you, I’d like to use whichever code that successfully helped you to achieve your original aim.

Meanwhile, I’ve received the code I was promised, and I’ve pasted it below for your examination: Code: Sub write Nums() Dim i As Integer, j As Integer, k As Integer, l As Integer, m As Integer, n As Integer, counter As Long ' create array to hold numbers required in 30 unique placeholders Dim arr Vals() Re Dim arr Vals(1 To 30) Dim x As Integer For x = 1 To 30 arr Vals(x) = Range("numbers"). Value ' swap (1,x) to (x,1) if using column instead of row Next x counter = 1 ' avoids header row ' write all unique combinations of numbers For i = 1 To 25 For j = i 1 To 26 For k = j 1 To 27 For l = k 1 To 28 For m = l 1 To 29 For n = m 1 To 30 counter = counter 1 Cells(counter, 1) = arr Vals(i) Cells(counter, 2) = arr Vals(j) Cells(counter, 3) = arr Vals(k) Cells(counter, 4) = arr Vals(l) Cells(counter, 5) = arr Vals(m) Cells(counter, 6) = arr Vals(n) Application.

Status Bar = Format(counter, "0,000,000") Next n Next m Next l Next k Next j Next i Application.

vb6 turn off screenupdating-11vb6 turn off screenupdating-1

If I know, I would ensure that the code is posted exactly the way it came to me, so that you’d see it in the proper code format. The information below may be useful: Combination is just a selection of certain objects, the order does not matter because we are just creating a group of objects.Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next Hi Pete, 1.As you might have observed, my knowledge in VB and programming is non-existent or, at best, very elementary (always willing to learn).That’s fine, I am using Excel 2010 that can handle up to a million rows. I also have a list of all the drawn lottery results.a) With the generated 6-number combinations occupying columns A to F, I intend to paste the drawn results in adjacent columns J to P – with columns J to O for the weekly drawn 6 numbers, and column P for the bonus number. The task at this stage is:- a) To get a VBA code that will take each set of drawn results (including the bonus number) in columns J to P and compare/match with all the generated combinations (A to F).

Leave a Reply