|
-
Aug 16th, 2007, 04:46 PM
#1
Thread Starter
Lively Member
[RESOLVED] Problem with data validation
Hi, I have a cell that has data validation (a list from another sheet), it displays the listbox with the possible values to be entered, but it lets the user type a non valid value using the keyboard.
I would like to know how can I prevent this from happening.
Thanks in advance
-
Aug 18th, 2007, 03:18 AM
#2
Re: Problem with data validation
i take it the list box is really a combobox, you can stop the user from typing in it by putting keyascii = 0 in the keypress event, this will not stop the user from pasting into the box
otherwise in the combobox change event put code to loop through all the items and if the text does not match prevent the lost focus by activating the combobox
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Aug 23rd, 2007, 11:55 AM
#3
Thread Starter
Lively Member
Re: Problem with data validation
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|