RE:Textbox que solo se puedan escribir numeros
la solucion anterior es muy ingeniosa, sin embargo solo funciona con numeros enteros, para decimales prueba esto :
Private Sub Text1_Change()
If IsNumeric(Me.Text1.Text) = False Then
If Trim$(Me.Text1.Text) <> vbNullString Then
Me.Text1.Text = vbNullString
End If
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> vbKeyBack And (KeyAscii < vbKey0 Or KeyAscii > vbKey9) Then
If KeyAscii = vbKeyDelete Then
If InStr(1, Me.Text1.Text, \".\") > 0 And Me.Text1.SelLength <> Len(Me.Text1.Text) Then
KeyAscii = 0
End If
Else
KeyAscii = 0
End If
End If
End Sub