View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Text Box Format

Use the Keypress event

Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 46 Then Exit Sub
If KeyAscii < 48 Or KeyAscii 57 Then
KeyAscii = 0
End If
End Sub

--
Regards,
Tom Ogilvy

"scrabtree23" wrote in message
...
I have a text box on a user form and I want to format it
so the user has to enter numbers (with a decimal) and the
result needs to be displayed in the text box as currency.
I don't want it to allow text. ???

SDC