<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
	<channel>
		<title>Excel VBA - Generate Pairs &#x26; Trips to a Text File</title>
		<link>/blogentry/44836</link>
		<atom:link href="https://www.lotterypost.com/rss/blogcomments/44836" rel="self" type="application/rss+xml" />
		<description>winsumloosesum's Blog: Excel VBA - Generate Pairs &#x26; Trips to a Text File</description>
		<dc:language>en-us</dc:language>
		<generator>Lottery Post RSS Generator</generator>
		<item>
			<title>Comment #2</title>
			<link>/blogentry/44836#c54596</link>
			<guid isPermaLink="true">/blogentry/44836#c54596</guid>
			<pubDate>Tue, 28 Sep 2010 19:10:57 GMT</pubDate>
			<dc:creator>luclc</dc:creator>
			<description><![CDATA[<p>&#x3c;br /&#x3e;can you please confirm.&#xa0; &#xa0;I would like to use this with  Pick3 or 6/49&#x3c;br /&#x3e;&#x3c;br /&#x3e;for&#xa0; &#xa0;6/49 I tried &#x3c;br /&#x3e;&#x3c;br /&#x3e;&#x3c;br /&#x3e;code:&#x3c;br /&#x3e;&#x3c;br /&#x3e;Sub Generate49C2() &#x3c;br /&#x3e;&#x3c;br /&#x3e;Open &#x22;c:\Lotto649\L649.txt&#x22; For Output As #1 &#x3c;br /&#x3e;&#x3c;br /&#x3e;For i1 = 1 To 49 - 1 &#x3c;br /&#x3e;&#xa0; &#xa0; For i2 = i1 + 1 To 49 - 0 &#x3c;br /&#x3e;&#xa0; &#xa0; &#xa0; &#xa0; &#x3c;br /&#x3e;&#xa0; &#xa0; &#xa0; &#xa0;&#xa0; &#xa0; &#xa0; &#xa0;&#xa0; &#xa0; &#xa0; LexiNum = LexiNum + 1 &#x3c;br /&#x3e;&#xa0; &#xa0; &#xa0; &#xa0;&#xa0; &#xa0; &#xa0; &#xa0;&#xa0; &#xa0; &#xa0; Print #1, Format(LexiNum, &#x22;000&#x22;) &#x26; &#x22; &#x22; &#x26; Format(i1, &#x22;0&#x22;) &#x26; &#x22;,&#x22; &#x26; Format(i2, &#x22;0&#x22;) &#x3c;br /&#x3e;&#xa0; &#xa0; &#xa0; &#xa0;&#xa0; &#xa0; &#xa0; &#xa0;  &#x3c;br /&#x3e;&#xa0; &#xa0; Next &#x3c;br /&#x3e;N... &#x5b;&#xa0;<a href="/blogentry/44836#c54596">More</a>&#xa0;&#x5d;</p>]]></description>
			<category>luclc</category>
		</item>
		<item>
			<title>Comment #1</title>
			<link>/blogentry/44836#c52828</link>
			<guid isPermaLink="true">/blogentry/44836#c52828</guid>
			<pubDate>Wed, 11 Aug 2010 01:03:47 GMT</pubDate>
			<dc:creator>GASMETERGUY</dc:creator>
			<description><![CDATA[<p>For those who do not program in Excel you must first call the VBA program.  This is done by pressing &#x22;Alt&#x22; and F11 at the same time.</p>]]></description>
			<category>GASMETERGUY</category>
		</item>
		<item>
			<title>Original Blog Entry: Excel VBA - Generate Pairs &#x26; Trips to a Text File</title>
			<link>/blogentry/44836</link>
			<guid isPermaLink="true">/blogentry/44836</guid>
			<pubDate>Tue, 10 Aug 2010 16:14:15 GMT</pubDate>
			<dc:creator>winsumloosesum</dc:creator>
			<description><![CDATA[<p>1. Create a new folder on your C: Drive and name it Lotto543 (c:\Lotto543)<br /><br />2. Open Excel and right-click any Tab at the bottom and select ViewCode<br /><br />3. When the Window opens go to the top Main Menu and select Insert Module<br /><br />4. Copy and paste the following code into the right workspace where you see the blinking cursor.<br /><br />Sub Generate43C2()<br /><br />Open c:\Lotto543\L543.txt For Output As #1<br /><br />For i1 = 1 To 43 - 1<br /><br />For i2 = i1 + 1 To 43 - 0<br /><br />LexiNum = LexiNum + 1<br /><br />Print #1, Format(LexiNum, 000 ) Format(i1, 0 ) , Format(i2, 0 )<br /><br />Next<br /><br />Next<br /><br />Close #1<br /><br />End Sub<br /><br />=======================================================================<br /><br />This generates all 903 Pairs for the 5/43 Lottery Game to a text file named L43.txt located at C:\Lotto543<br /><br />If your drive designation is different from C:\ then you will need to change the following code to reflect the code:<br /><br />For example if your drive designation is the letter D:\ you would change th following line of code to the following:<br /><br />Open d:\Lotto543\L543.txt For Output As #1<br /><br />============================================================================<br /><br />If your Lottery Game is a 5/39 game you can change or create a new folder and name the folder c:\Lotto539<br /><br />and change the following code:<br /><br />Sub Generate39C2()<br /><br />Open c:\Lotto539\L539.txt For Output As #1<br /><br />For i1 = 1 To 39 - 1<br /><br />For i2 = i1 + 1 To 39 - 0<br /><br />LexiNum = LexiNum + 1<br /><br />Print #1, Format(LexiNum, 000 ) Format(i1, 0 ) , Format(i2, 0 )<br /><br />Next<br /><br />Next<br /><br />Close #1<br /><br />End Sub<br /><br />=======================================================================<br /><br />The LexiNum is actually the Lexicographic Pairs designation number.<br /><br />The Excel formula for calculating the number of pairs in your lottery game is =COMBIN(43,2) where X is the total number of balls (43) and N is the number of digits = 903 for a 5/43 game<br /><br />or =COMBIN(39/2) = 741 Pairs for a 5/39 lottery game.<br /><br />=======================================================================<br /><br />For creating 3 Number Combinations (9,139) for a 5/39 Game =COMBIN(39,3). This code below will generate all 9,139 trips to your folder C:\Lotto539. If you open the folder you should see a text file L539Trips.txt inside the folder. Remember to create your new folder c:\Lotto539 first before running the code.<br /><br />Sub Generate39C3()<br /><br />Open c:\Lotto539\L539Trips.txt For Output As #1<br /><br />For i1 = 1 To 39 - 2<br /><br />For i2 = i1 + 1 To 39 - 1<br /><br />For i3 = i2 + 1 To 39 - 0<br /><br />LexiNum = LexiNum + 1<br /><br />Print #1, Format(LexiNum, 000 ) Format(i1, 0 ) , Format(i2, 0 ) , Format(i3, 0 )<br /><br />Next<br /><br />Next<br /><br />Next<br /><br />Close #1<br /><br />End Sub<br /><br />======================================================================================<br /><br />Good Luck!!<br /><br />... &#x5b;&#xa0;<a href="/blogentry/44836">More</a>&#xa0;&#x5d;</p>]]></description>
			<category>Blog Entry</category>
			<category>winsumloosesum</category>
			<wfw:comment>https://www.lotterypost.com/blogentry/44836</wfw:comment>
		</item>
	</channel>
</rss>

