+ Reply to Thread
Results 1 to 17 of 17

searchable dropdown blocking blocking invalid data

  1. #1
    Registered User
    Join Date
    01-19-2020
    Location
    Hungary
    MS-Off Ver
    Office 2007
    Posts
    19

    searchable dropdown blocking blocking invalid data

    Hi,

    I created searchable dropdown in different columns. Currently I only use Application.Calculate in VBA. The dropdown is working but the macro should also alert If somebody fills invalid data into the active.cell. The alert should "Please select from valid data from dropdown list".

    Can somebody help me to solve this problem?

    Thank you,
    BR,
    Balazs

  2. #2
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: searchable dropdown blocking blocking invalid data

    Can you attach your file? Please read the yellow banner at the top of the thread.

  3. #3
    Registered User
    Join Date
    01-19-2020
    Location
    Hungary
    MS-Off Ver
    Office 2007
    Posts
    19

    Re: searchable dropdown blocking blocking invalid data

    Hi,

    I created the searchable dropdown list based on youtube video called "searchable drop down list in excel multiple cell"

    This is a really good solution but one feature is missing. I want to block If somebody writes invalid data to the activecell within the dropdown column (e.g. The user filles "Devel" into the cell but the valid data is "Developer". In this case macro should pops up a message "Please select valid data from dropdown list"). So If the user start writing in the cell, the macro should not allow the user to leave the cell till valid data is not entered in cell (The user should be able to select from dropdown list or can enter the valid data which matches one of the dorpdown fields).

    Thank you very much for your help,

    BR,
    Balazs

  4. #4
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: searchable dropdown blocking blocking invalid data

    Well, without seeing your file I can't test it.

  5. #5
    Registered User
    Join Date
    01-19-2020
    Location
    Hungary
    MS-Off Ver
    Office 2007
    Posts
    19

    Re: searchable dropdown blocking blocking invalid data

    Hi Akuini, Sorry for the delay. Please find attached the file. I should implement this feature in A, E, J column in sheet "Sercha Dropdown in column A,E,J". Can you help?
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: searchable dropdown blocking blocking invalid data

    This is a really good solution but one feature is missing. I want to block If somebody writes invalid data to the activecell within the dropdown column ... In this case macro should pops up a message "Please select valid data from dropdown list")....
    1. Both feature are in "Error alert" tab in data validation, do you mean it doesn't work on your data validation set up?

    2. Your file is password protected, I can't check the data validation.

  7. #7
    Registered User
    Join Date
    01-19-2020
    Location
    Hungary
    MS-Off Ver
    Office 2007
    Posts
    19

    Re: searchable dropdown blocking blocking invalid data

    Sorry, password is "Nemzetisport89".

    "The Show error alert after invalid data is inserted" in data validation is turned off otherwise searchable dropdown function is not working. The feature is working but I want to block the user to leave invalid data in the cell when they are typing data in the dropdown cell. For example If the user wants to fill "A5" cell and they type "Project", they must fill the whole project name or select from dropdown list (e.g. must type or select Project2 or Project3). The macro should restrain the user to leave "Project" in the cell because this name is not in the dropdown list. In this case a message should remind the user to type valid data or select a name from dropdown list.

  8. #8
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: searchable dropdown blocking blocking invalid data

    Ok, try this:
    1. I created 3 named range:
    Please Login or Register  to view this content.
    2. I put this code in sheet "Sercha Dropdown in column A,E,J" code module.
    Please Login or Register  to view this content.
    The file:
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-19-2020
    Location
    Hungary
    MS-Off Ver
    Office 2007
    Posts
    19

    Re: searchable dropdown blocking blocking invalid data

    It works quite well but sometimes I get error (e.g.Error number 50290:Method 'Union' of object _Global' failed"). It does not always happen. The error appeared when I type inavlid data and tried to to click to another cell (strange because the error pops up occasionally). The debug is highlighted in "Application.EnableEvents = True" I tested the file sent by you. Do you have any idea what is the problem? Tested file attached. Thank you for your help.
    Attached Files Attached Files
    Last edited by Balazs Batta; 01-24-2020 at 12:49 PM.

  10. #10
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: searchable dropdown blocking blocking invalid data

    I can't reproduce the error, but in the mean time try changing "Union" to "Application.Union"

    Please Login or Register  to view this content.
    if the problem persists, I will try something else.

  11. #11
    Registered User
    Join Date
    01-19-2020
    Location
    Hungary
    MS-Off Ver
    Office 2007
    Posts
    19

    Re: searchable dropdown blocking blocking invalid data

    I have changed the code in the excel but the erro still appears. I am enclosing the snip about the error.
    Attached Images Attached Images

  12. #12
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: searchable dropdown blocking blocking invalid data

    If you don't have any data below the table in sheet "Sercha Dropdown in column A,E,J", try replacing this:

    Please Login or Register  to view this content.
    with this:

    Please Login or Register  to view this content.
    Note: 10000 is the possible maximum row of the table, you might change that to suit.

  13. #13
    Registered User
    Join Date
    01-19-2020
    Location
    Hungary
    MS-Off Ver
    Office 2007
    Posts
    19

    Re: searchable dropdown blocking blocking invalid data

    Now I get "Error number 50290: Method 'intersect' of object'_Global' failed"

  14. #14
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: searchable dropdown blocking blocking invalid data

    Hm, I still can't reproduce the error, so it's hard to debug. So I think this approach isn't suitable for your project.

    As an alternative, in case you're interested.
    I've developed a searchable combobox that can function as your searchable data validation, and maybe even better.
    You can try it. Let me know if you're interested in this method.

  15. #15
    Registered User
    Join Date
    01-19-2020
    Location
    Hungary
    MS-Off Ver
    Office 2007
    Posts
    19

    Re: searchable dropdown blocking blocking invalid data

    Administrative note

    This post has been deleted by MOD as OP has started this new thread with it https://www.excelforum.com/excel-pro...ml#post5267151 ( subject not directly related)
    Last edited by Pepe Le Mokko; 01-26-2020 at 11:52 AM.

  16. #16
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: searchable dropdown blocking blocking invalid data

    It would be better if you start a new thread because it will attract more helpers to try to find a solution to your problem and also this is a new problem.

  17. #17
    Registered User
    Join Date
    01-19-2020
    Location
    Hungary
    MS-Off Ver
    Office 2007
    Posts
    19

    Re: searchable dropdown blocking blocking invalid data

    Hi Aukini, I have started a new thread but nobody replied. Do not you have any idea how I can solve this issue? I really appreciate your support.

    https://www.excelforum.com/excel-pro...ml#post5267606

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Data input blocking
    By BullseyeThor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2018, 11:51 AM
  2. Blocking a macro button if data is not entered
    By Kanashii7 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-29-2016, 09:06 AM
  3. Need Data Validation rule for Blocking a cell
    By Karthik Sen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-10-2013, 12:14 AM
  4. blocking entries with data validation
    By jcavigli in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2008, 05:00 AM
  5. [SOLVED] Blocking entry of data in a cell
    By Rob in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-05-2006, 11:45 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1