HI I have a userform with various textboxes in it. one textbox I want to only contain numbers so I have the following code trigger if a letter is entered
This works fine when the property of the userform modal is set to true. the current textbox highlights the current text for me to overwrite. the problem is when I switch the userform to modal = false it doesn't work.![]()
If Not IsNumeric(supplierpricetxt.Value) Then MsgBox "Sorry, only numbers allowed" With supplierpricetxt .SelStart = 0 .SelLength = Len(.Text) End With Cancel = True Exit Sub End If
Any ideas why this is and whether there is a simple workaround.
Also the above code will allow eg 100 to be entered or £100. Is there a way to exclude the £100 being accepted.
thanks in advance and happy new year
Bookmarks