Adam7891
|
性 別: 女
命中機率: 0%
註冊時間: 2017/10/09
總發文數: 1
總回應數: 0
手機號碼: 已驗證 |
|
發表於 2017/10/09 22:48 |
|
|
你好,小弟希望能看到所有威力彩的排列組合,以下是我嘗試修改的數值,希望能讓一格顯是6+1個號碼,但現在只能讓每一格顯示第一區1~38號,無法顯示第二區1~8號,請教該如何修改,才能讓每一格顯示"1,2,3,4,5,6,8"、"21,22,23,24,25,26,1"這種排列組合呢,謝謝。
Private Sub CommandButton1_Click()
Dim a(38) As String, i As Integer
For i = 1 To 38
a(i) = i
Next
Test a, "", 1, 0, 1, 1
End Sub
Sub Test(a() As String, S As String, p As Integer, t As Integer, r As Long, c As Long)
Dim i As Integer
If t = 6 Then
Cells(r, c) = Left(S, Len(S) - 1)
r = r + 1
If r > 983025 Then r = 1: c = c + 1
Exit Sub
End If
For i = p To UBound(a)
Test a, S & a(i) & ",", i + 1, t + 1, r, c
Next
End Sub
系統提示:回文是基本的美德以及對發文者的支持與鼓勵哦! 立即回文 |
|
|