慕田峪7331174
2022-04-04 09:09:53
表里有hy,mm,a 字段已知字段hy=1,2,3已知字段mm=4,5,6已知字段a=1234,2345,3456,a=split(a,",")hy=split(hy,",")mm=split(mm,",")for i=0 to ubound(a)條件:我想讓他只提出2345想對應的數據比如說:我現在想條件知道2345 那數據就是 2 5 2345跪求?。?!
1 回答

白板的微信
TA貢獻1883條經驗 獲得超3個贊
Private Enum mytable
thy = 1
tmm = 2
ta = 3
End Enum
Private a, hy, mm
Private Function FindData(ByVal findText As String, Optional ByVal nType As mytable = ta) As String
Dim tem
Select Case nType
Case thy: tem = hy
Case tmm: tem = mm
Case ta: tem = a
End Select
For i = 0 To UBound(tem)
If tem(i) = findText Then
FindData = hy(i) & "," & mm(i) & "," & a(i)
Exit For
End If
Next
End Function
Private Sub Form_Load()
hy = Split("1,2,3", ",")
mm = Split("4,5,6", ",")
a = Split("1234,2345,3456", ",")
Me.Caption = FindData("1234")
End Sub
看下這個試驗代碼,可能對你有用!!!! ^_^
添加回答
舉報
0/150
提交
取消