Solved

Validation Lists Default value

Posted on 2013-05-10
8
299 Views
Last Modified: 2013-05-10
Morning all,

I have two validation list.   The second one is depended on the value in the first.  I was wondering if there was a way after the value in the first list is select that it would default the second list to the first item in the list and you could still change the value if needed.  

Thanks,
Montrof
0
Comment
Question by:montrof
  • 5
  • 3
8 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39155449
You would have to use code for that. We'd need to see a workbook to provide details, really.
0
 
LVL 1

Author Comment

by:montrof
ID: 39155645
0
 
LVL 1

Author Comment

by:montrof
ID: 39155649
Attached is an example of the data.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 39155858
You need to sort your list by region for your DV to work properly by the way (you still get duplicates).

Anyway, right-click the worksheet tab, choose View Code and then paste this in:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("D2")) Is Nothing Then
        On Error Resume Next
        Application.EnableEvents = False
        Range("D3").Value = Evaluate(Range("D3").Validation.Formula1)(1)
        Application.EnableEvents = True
    End If
End Sub

Open in new window

0
 
LVL 1

Author Comment

by:montrof
ID: 39155941
One thing I already have a Worksheet_Change event can you have multiple for one sheet?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39155983
No, you'll have to combine them.
0
 
LVL 1

Author Comment

by:montrof
ID: 39155991
This is the other even i have


Private Sub Worksheet_Change(ByVal Target As Range) more than 13 months
If Intersect(Target, Range("e2")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
    If (Worksheets("List").Range("e6").Value - Worksheets("List").Range("e7").Value) > 396 Then
        Worksheets("List").Range("e3") = Worksheets("Parameters").Range("e161")
    End If
End Sub

Open in new window

0
 
LVL 1

Author Comment

by:montrof
ID: 39155995
could you show me how to combine them I posted the other event

Thanks,
montrof
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question