- Home
- Premium Memberships
- Lottery Results
- Forums
- Predictions
- Lottery Post Videos
- News
- Search Drawings
- Search Lottery Post
- Lottery Systems
- Lottery Charts
- Lottery Wheels
- Worldwide Jackpots
- Quick Picks
- On This Day in History
- Blogs
- Online Games
- Premium Features
- Contact Us
- Whitelist Lottery Post
- Rules
- Lottery Book Store
- Lottery Post Gift Shop
The time is now 8:52 am
You last visited
May 21, 2024, 8:52 am
All times shown are
Eastern Time (GMT-5:00)
Excel - Creating Pick 3 and Pick 4 Combinations VBA
Published:
Below is a link for creating 1,000 Pick 3 combinations and 10,000 Pick 4 combinations:
http://www.box.net/shared/t9ktq6klm5
Thanks to GillesD at lotto649 forum.
=====================================================
Pick 4 Code:
Option Explicit
Dim A As Integer, B As Integer, C As Integer, D As Integer
Dim X As Double
Sub CombininationsPick4()
Columns("A:E").Select
Selection.ClearContents
Range("G1").Select
' Generates all combinations for a pick-4 lottery
Range("A1").Select
X = 1
For A = 0 To 9
For B = 0 To 9
For C = 0 To 9
For D = 0 To 9
ActiveCell.Offset(X, 0).Value = X
ActiveCell.Offset(X, 1).Value = A
ActiveCell.Offset(X, 2).Value = B
ActiveCell.Offset(X, 3).Value = C
ActiveCell.Offset(X, 4).Value = D
X = X + 1
Next D
Next C
Next B
Next A
End Sub
===============================================
Pick 3 Code:
Option Explicit
Dim A As Integer, B As Integer, C As Integer
Dim X As Double
Sub CombininationsPick3()
Columns("A:D").Select
Selection.ClearContents
Range("G1").Select
' Generates all combinations for a pick-3 lottery
Range("A1").Select
X = 1
For A = 0 To 9
For B = 0 To 9
For C = 0 To 9
ActiveCell.Offset(X, 0).Value = X
ActiveCell.Offset(X, 1).Value = A
ActiveCell.Offset(X, 2).Value = B
ActiveCell.Offset(X, 3).Value = C
X = X + 1
Next C
Next B
Next A
End Sub
===========================================================
Comments
This Blog entry currently has no comments.
Post a Comment
Please Log In
To use this feature you must be logged into your Lottery Post account.
Not a member yet?
If you don't yet have a Lottery Post account, it's simple and free to create one! Just tap the Register button and after a quick process you'll be part of our lottery community.
Register