+ Reply to Thread
Results 1 to 3 of 3

Data dependent drop down list in VBA

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    Newport, Wales
    MS-Off Ver
    Excel 2007
    Posts
    24

    Question Data dependent drop down list in VBA

    Hi guys,

    I'm trying to create, via VBA, a macro to create a new order with:

    A) a drop down list for Account Ref (AC Ref), starting in Cell E3
    B) creating a dependant drop down list in F3 (Using the formula as the source "=OFFSET(AnchorCell, 1, MATCH($e3, Customers, 0)-1, COUNTA(OFFSET(AnchorCell, , MATCH($e3,Customers, 0)-1, 50, 1))-1, 1)". (I have placed the formula above in cell F10 for display purposes only but will obviously delete this when a solution is found)

    The problem I have is that when creating the next line entry, via clicking the "New Entry" button, the formula still looks at $e3, and I need it to move to E4. Obviously the next new entry would move to E5 and so on


    Regards
    Attached Files Attached Files
    Last edited by kawa13; 12-14-2016 at 06:54 AM. Reason: Solution provided

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data dependent drop down list in VBA

    Don't let your access to VBA make things harder than they need to. With your current approach, any changes to the design of your sheet would require rewrite of all your code, too. Ugh.

    Better.... use row3 of your sheet as a template. Basically, as long as row3 is setup and working the way you want, then this simple "copy" macro will copy that to the next empty row down below and remove any constants. Any formulas will adjust themselves, including properly constructed data validation.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-11-2013
    Location
    Newport, Wales
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Data dependent drop down list in VBA

    Excellent mate. Far better than my laborious solution. Many, many thanks

+ 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. Replies: 0
    Last Post: 04-24-2015, 02:27 PM
  2. [SOLVED] Data Validation - Drop-down Dependent List
    By l3il3i in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2014, 03:46 AM
  3. [SOLVED] Dependent Drop down list with DEPENDENT DEFAULT VALUE
    By ginieman in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-28-2013, 03:56 AM
  4. [SOLVED] Dependent drop down list based on matching data
    By CUNLA in forum Excel General
    Replies: 4
    Last Post: 10-09-2012, 03:24 PM
  5. Replies: 1
    Last Post: 06-21-2012, 11:36 AM
  6. [SOLVED] Dependent Drop down list with DEPENDENT DEFAULT VALUE (e.g. Blank)
    By Waqar Ali in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-26-2012, 06:31 AM
  7. Replies: 2
    Last Post: 05-12-2011, 09:23 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