+ Reply to Thread
Results 1 to 3 of 3

Dependent Drop down list with dependant default value for entire column

  1. #1
    Registered User
    Join Date
    09-03-2021
    Location
    UK
    MS-Off Ver
    Vista
    Posts
    2

    Dependent Drop down list with dependant default value for entire column

    Hi I was using JBeaucaire's code to deal with a similar problem to this:

    /excel-programming-vba-macros/715111-dependent-drop-down-list-with-dependent-default-value.html

    However, I would like to generalise the code such that if any cell is changed in column B the offset cell in column c changes to the first value in its drop down list.
    i.e if AggreateSand is changed in cell B7 to Asphalt the cell C7 would show Asphalt, General.

    Any help would be much appreciated - many thanks!
    Attached Files Attached Files
    Last edited by ST1309; 09-03-2021 at 01:00 PM. Reason: This worked for me thank you!

  2. #2
    Registered User
    Join Date
    09-03-2021
    Location
    UK
    MS-Off Ver
    Vista
    Posts
    2

    Re: Dependent Drop down list with dependant default value for entire column

    Typically worked it out 2 mins after posted for future reference:

    Option Compare Text 'makes macro non-case-sensitive

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub

    If Target.Column = 2 Then
    Application.EnableEvents = False
    Select Case Target.Value
    Case "AggregateSand": Target.Offset(0, 1).Value = "AggregateSand, General aggregate and sand"
    Case "Asphalt": Target.Offset(0, 1).Value = "Asphalt, General"
    Case Else: Target.Offset(0, 1).Value = ""
    End Select
    Application.EnableEvents = True
    End If

    End Sub

  3. #3
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,313

    Re: Dependent Drop down list with dependant default value for entire column

    Alternative approach - no data validation - no conditional formatting - no on-sheet formula - no hard coded defaults - alter the tables to give you your choices.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

+ 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. Dependent default value and drop down list
    By SimeDarby in forum Excel General
    Replies: 12
    Last Post: 12-19-2017, 06:51 AM
  2. Mutiple dependent drop down list with a fallback/default list on error.
    By static in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-12-2014, 06:48 PM
  3. multiple Dependent drop down list with default value
    By Dansolo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-12-2014, 01:27 PM
  4. [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
  5. [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
  6. Default Blanks in Dependent Drop Down List
    By rlmtf7 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2011, 09:37 AM
  7. Create Default for Dependent Drop Down List
    By moskealy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-14-2010, 03:11 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