[VBA ] Array宣告問題
Sub SwapBlank(BtnNo As Variant)
Dim i As Integer
Dim Neighbors
Neighbors = Array(Array("2","4"),_
Array("1","3","5"),_
Array("2","6"),_
Array("1","5","7"),_
Array("2","4","6","8"),_
Array("3","5","9"),_
Array("4","8"),_
Array("5","7","9"),_
Array("6","8"))
If Controls("CommandButton"& BtnNo).Caption<>""Then
For i = 1 To UBound(Neibors(BtnNo))
If Controls("CommandButton"&Neighbors(BtnNo)(i)).Caption = "" Then
Controls("CommandButton"&Neighbors(BtnNo)(i)).Caption =
Controls("CommandButton"&BtnNo).Caption)
Controls("CommandButton"&BtnNo).Caption = ""
Exit For
End If
Next i
End If
End Sub
可以請問這樣ARRAY宣告部分有錯誤嗎? 錯的話應該怎麼訂正??
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.233.146.192
※ s963870:轉錄至看板 Programming 05/31 22:51
→
06/01 00:37, , 1F
06/01 00:37, 1F
→
06/01 08:35, , 2F
06/01 08:35, 2F