Solved

Validation Lists Default value

Posted on 2013-05-10
8
292 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

930 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now