VBA,如何取文本框内之用空格分隔的两个数值?

2024-11-17 17:47:59
推荐回答(2个)
回答(1):

a=left(textbox1.text,instr(textbox1.text," ")-1)
b=mid(textbox1.text,instr(textbox1.text," ")+1)

回答(2):

窗体中的控件可用下面的方法:
-------------
Private Sub CommandButton1_Click()
Dim c As Control
For Each c In Me.Controls
If LCase(TypeName(c)) = "textbox" Then
c.Text = ""
' MsgBox TypeName(c) & " = ""textbox"""
Else
' MsgBox TypeName(c) & " <> ""TextBox"""
End If
Next
End Sub