作者s963870 (flare0118)
看板Programming
标题[问题][VBA ] Array宣告问题
时间Tue May 31 22:51:56 2011
※ [本文转录自 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)