[問題][VBA ] Array宣告問題
※ [本文轉錄自 Visual_Basic 看板 #1DvF-YI2 ]
作者: s963870 (flare0118) 看板: Visual_Basic
標題: [問題][VBA ] Array宣告問題
時間: Tue May 31 22:47:59 2011
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
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.233.146.192
※ 編輯: s963870 來自: 125.233.146.192 (05/31 22:52)
※ 編輯: s963870 來自: 125.233.146.192 (05/31 22:53)
※ 編輯: s963870 來自: 125.233.146.192 (05/31 22:59)
Programming 近期熱門文章
PTT數位生活區 即時熱門文章
7
20