Results 1 to 3 of 3

Thread: [RESOLVED] Problem with data validation

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Resolved [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

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    70

    Re: Problem with data validation

    Thanks a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width