1个回答
展开全部
Private Sub Command1_Click()
Dim i As Integer, n As String
Dim a As Variant
a = Array(1, 2)
a(0) = Array("0001", "0002", "0003", "0004", "0005")
a(1) = Array("name1","name2","name3","name4","name5")
n = InputBox("No.")
For i = 0 To 4
If a(0)(i) = n Then MsgBox "Name:" & a(1)(i)
Next
End Sub
Dim i As Integer, n As String
Dim a As Variant
a = Array(1, 2)
a(0) = Array("0001", "0002", "0003", "0004", "0005")
a(1) = Array("name1","name2","name3","name4","name5")
n = InputBox("No.")
For i = 0 To 4
If a(0)(i) = n Then MsgBox "Name:" & a(1)(i)
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询