Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Difficulty restricting characters
I've used the following code to try and restrict certain characters to a textbox: Private Sub TextBox2_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case Asc(".") If InStr(1, Me.TextBox1.Text, ".") 0 Then KeyAscii = 0 End If End Select End Sub The period is not the only character I'm trying to restrict but it is one of them. Whenever I've tried to use 'Select Case', the code never seems to do anything... at all. The Textbox2 is used as the savename so I can't allow any weird characters to get typed in. Can anyone help me out regarding this? Thanks, Kartune85 -- kartune85 ------------------------------------------------------------------------ kartune85's Profile: http://www.excelforum.com/member.php...o&userid=35586 View this thread: http://www.excelforum.com/showthread...hreadid=569743 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Restricting Number of characters in a cell | Excel Worksheet Functions | |||
Difficulty cleaning some char(63) characters | Excel Worksheet Functions | |||
restricting use of certain characters | Excel Discussion (Misc queries) | |||
restricting input characters | Excel Programming | |||
Restricting Characters in a cell. | Excel Programming |