Hi,
I'm looking for the answer to this please...
I have a text box and I want it so that if the user has not typed in the number 1 then it won't let him leave the box.
Can anyone tell me how to do this?
Thanks
John
Hi,
I'm looking for the answer to this please...
I have a text box and I want it so that if the user has not typed in the number 1 then it won't let him leave the box.
Can anyone tell me how to do this?
Thanks
John
Hi,
i recently used something like this....
guess you would have this...![]()
Please Login or Register to view this content.
HTH![]()
Please Login or Register to view this content.
Spinkung.![]()
Hi, thanks for the quick reply..
My code is
Private Sub TextBox1_AfterUpdate()
If TextBox1.Value <> "1" Then
MsgBox "This should be 1"
Me.TextBox1.SetFocus
End If
End Sub
This code recognises that 1 hasn't been entered and returns the correct msgbox but it still jumps to the next box.
Any ideas?
Thanks
John
Hi,
HTH![]()
Please Login or Register to view this content.
Carim
![]()
Thanks for the reply.
I tried your method (I had to edit it to suit) but the msgbox keeps coming back up every time I cancel it and I have to close Excel to start working again.
Thanks for your help but I think I am just going to leave it for now.
Cheers
John
Might it be easier to use a cell with data validation?
You could select that the entry has to be a number, and use the 'equal to' and type the number 1, you could then tick the 'ignore blank' box which would prevent them moving from the cell till they had entered it, and you could use the 'Error Alert' tab to tell them they have to enter the number 1.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks