Public psd As Integer Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then '打完字要按Enter psd = Val(Text1.Text) End If 'MsgBox psd End Sub