LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,071
Default Excel -- Data Validation -- Create Dependent Lists

Louisa
You have a data validation cell with choices of Yes and No. Is that
right? You want that cell to display N/A if the user selects No. Is that
right? If this is right then, yes, you can do that but it will take VBA to
do it. The following macro will do that for you. I assumed that the data
validation cell is A1. Change that in the macro as needed. This is a sheet
macro and must be placed in the sheet module of that sheet. You access that
module by right-clicking on the sheet tab and selecting View Code. Paste
this macro into that module. "X" out of the module to return to your sheet.
When you set up the data validation in that cell, you must select to NOT
display an error message if a wrong value is entered. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Not Intersect(Target, Range("A1")) Is Nothing Then
If UCase(Target) = "NO" Then
Application.EnableEvents = False
Target = "N/A"
Application.EnableEvents = True
End If
End If
End Sub
"Louisa" wrote in message
...
Hi

Can you create an automatic default value if you choose one option from a
drop down list and a dependant list if you do not.

I have been to the following website
"http://www.contextures.com/xlDataVal02.html"and have managed to create
the
dependent lists and if I choose the yes answer then I get one list and if
I
choose no then I get another but what I can not seem to do is to get it to
default automatically to one value if I choose no ie.
I have a yes or no drop down and if you answer No then I want it to
automatically assign N/A but if yes is chosen then they need to choose
from
the applicable drop down list. At the moment you have to go into the cell
and
choose N/A when you pick a No answer

I hope someone get help me

Thanks

Louisa




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation-Dependent Lists TonyK Excel Discussion (Misc queries) 2 February 12th 09 10:21 PM
Data validation dependent lists Negative numbers in brackets Excel Discussion (Misc queries) 4 November 9th 07 06:11 AM
Data Validation and Dependent Lists Q Sean Excel Worksheet Functions 4 May 19th 07 07:19 PM
Data Validation & Dependent Lists Bob Excel Worksheet Functions 3 December 21st 06 02:38 PM
Data Validation - Create dependent lists Little pete Excel Discussion (Misc queries) 1 May 23rd 05 12:04 PM


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"