LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Control content of text boxes on a userform

Thanks I'll give this a try
Angela
-----Original Message-----
Hi Angela,
A way of making:
Private Sub TextBox1_Change()
Me.TextBox1 = CleanChain(Me.TextBox1)
End Sub

Private Function CleanChain(Chain As String) As String
Const Cars As String = "0123456789,."
Dim L As String * 1, i As Integer
For i = 1 To Len(Chain)
L = Mid(Chain, i, 1)
Select Case L
Case ",", "."
L = Application.International(xlDecimalSeparator)
If InStr(1, CleanChain, L) Then GoTo 1
End Select
If InStr(1, Cars, L) Then CleanChain = CleanChain & L
1: Next i
End Function

MP

"Angela" a écrit

dans le message de
...
I am aware of data validation in cells to force text or
numeric values. Is there a way of doing this in a
userform text box?

You can assign the value of a textbox to a numeric
variable, but this is too late when you have clicked

the
OK button

Any help gratefully received



.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
Changing color in text boxes based on content oldybutgoody Excel Discussion (Misc queries) 1 October 23rd 07 04:42 PM
Dynamic Text boxes in UserForm Kelley[_2_] Excel Programming 2 November 18th 03 05:59 PM
Populate Userform text boxes in VBA with VLookup data from #2 worksheet Laz[_2_] Excel Programming 4 October 8th 03 02:15 AM
userform text boxes Jo[_4_] Excel Programming 4 September 23rd 03 03:38 AM


All times are GMT +1. The time now is 07:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"