+ Reply to Thread
Results 1 to 11 of 11

VBA for variable lookup from data validation list

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    VBA for variable lookup from data validation list

    Hi All,
    I am after VBA code that will basically lookup a variable range of values in reference to 3 separate data validation lists. The tricky part is that I want the results of each lookup under each other the with no row gaps regardless of how many results the reference gives. Confused? I hope this makes sense to someone because this will be a great help if it can be done! Please see attached spreadsheet.

    As an example I have populated the lists with:
    Product Range 1
    Product Range 2
    Product Range 3

    The lookup values for these groups found on the ‘Ranges’ sheet are:
    12151632
    12071779 12071882
    12097730 12071890

    So the end result on the 'Promo' sheet from A3 down when these product ranges are selected in the 3 lists will be the below sequence:
    12151632
    12071779
    12071882
    12097730
    12071890

    Appreciate any assistance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: VBA for variable lookup from data validation list

    Hi Ravenous,

    I hope that this procedure will do the job:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA for variable lookup from data validation list

    my thoughts

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: VBA for variable lookup from data validation list

    Nice work stnkynts!

  5. #5
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: VBA for variable lookup from data validation list

    Thanks fellas! How do I make it run automatically everytime the selection changes?

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA for variable lookup from data validation list

    Do you mean this?

    Please Login or Register  to view this content.
    Or does it need to copy over based on all 3 values? This one only copies over the changed cells lookup values.

  7. #7
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: VBA for variable lookup from data validation list

    Sorry i'm new to this and not sure how to make this code run but I could with the first one. What is the difference between a sub and a private sub?

    Thanks

  8. #8
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: VBA for variable lookup from data validation list

    The Sub Worksheet_Change procedure should be put in the "Thisworkbook" module.

  9. #9
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA for variable lookup from data validation list

    Close, it would be put under the Sheet1 (Promo).

  10. #10
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: VBA for variable lookup from data validation list

    Oh, my mistake!

  11. #11
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: VBA for variable lookup from data validation list

    Sorted! Thanks to you both for your help.

+ 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. Validation and data lookup from more then one variable
    By teashaandrew in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-05-2013, 06:50 PM
  2. Replies: 1
    Last Post: 09-13-2012, 03:46 PM
  3. Validation List Using Variable
    By jamgood96 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2011, 02:33 PM
  4. Lookup Value based off Data Validation List / Populate Form
    By snake10 in forum Excel - New Users/Basics
    Replies: 13
    Last Post: 03-22-2009, 02:57 PM
  5. Lookup with two variable data list cells
    By Monkey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-10-2005, 08:06 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