+ Reply to Thread
Results 1 to 3 of 3

Run-time error '1004' while using multi-level drop down menus

  1. #1
    Registered User
    Join Date
    03-18-2021
    Location
    Sydney
    MS-Off Ver
    Version 2008
    Posts
    4

    Lightbulb Run-time error '1004' while using multi-level drop down menus

    Hey there,

    I have a table with some columns that are text fields (e.g. name) and then some columns that are single or multi-level drop down menus. The idea is that you enter a name first in one of the text fields, and then go to the drop downs and select your options. The drop downs work well, and I also wrote a VBA script to clear the content of the drop downs if you select another option from the menu (e.g. you change your first selection, then fields in drop down 2 and 3 will be set to blank).

    If I, however, change or write something in the text fields, the script throws an exception ('1004') because the Target.Validation.Type = 3 has a value 'Expression not defined in context'. I added the script to this post. I created the drop downs using data validations.

    Note: columns M, N, O, P, Q are the drop downs (referring to 13, 14 and 16 in the script)

    Let me know if you need more details!

    Thanks for your help!
    G.
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Run-time error '1004' while using multi-level drop down menus

    If you change a cell that is not a Data Validation cell, then you cannot check that cell's .Validation.Type.

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    03-18-2021
    Location
    Sydney
    MS-Off Ver
    Version 2008
    Posts
    4

    Re: Run-time error '1004' while using multi-level drop down menus

    Thanks so much AlphaFrog!! It works perfectly with your script above :-)

+ 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. [SOLVED] multi level dependent drop down list
    By (T_T) in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2020, 06:02 AM
  2. Replies: 3
    Last Post: 06-04-2020, 06:12 PM
  3. Replies: 5
    Last Post: 05-14-2016, 01:24 AM
  4. [SOLVED] Multi Level Dependent Drop Down Lists
    By mysticmoron109 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-03-2015, 03:35 PM
  5. Multi level dependantly linked drop down boxes
    By MattHutchings in forum Excel General
    Replies: 3
    Last Post: 08-10-2012, 09:57 PM
  6. Multi Level Dependent Drop-down list, Explanation required
    By Shoieb.arshad in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-31-2012, 11:36 AM
  7. Drop Down Issue - multi level filter
    By burblecut in forum Excel General
    Replies: 3
    Last Post: 08-19-2010, 04:54 PM

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