Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ben Ben is offline
external usenet poster
 
Posts: 509
Default How to clear validation lists based on other validation lists

Hi,

Let's say you have 2 validation lists, the first one being the "parent" cell
and then the second one being the "child" cell. The list in the childs cell
is based on the selection made in the parents cell. Now my question is if i
select i new value in the parent cell how can i get the child cell to clear?

I tried this but it didn't work,

=IF(G8="","",IF(G8="All",Div,OFFSET(Dept,MATCH(G8, DeptCol,0)-1,1,COUNTIF(DeptCol,G8),1)))
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to clear validation lists based on other validation lists

If you want to actually clear the second cell, you're going to have to use a
macro--maybe an event macro like this:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
Set myCell = Me.Range("a1")
If Intersect(Target, myCell) Is Nothing Then Exit Sub

If IsEmpty(myCell.Value) Then
Application.EnableEvents = False
me.range("B1").Value = ""
Application.EnableEvents = True
End If

End Sub

If you want to try, I had my parent cell as A1 and my child as B1.

Rightclick on the worksheet tab that should have this behavior. Select view
code and paste this in (adjust those addresses). Then back to excel.


Ben wrote:

Hi,

Let's say you have 2 validation lists, the first one being the "parent" cell
and then the second one being the "child" cell. The list in the childs cell
is based on the selection made in the parents cell. Now my question is if i
select i new value in the parent cell how can i get the child cell to clear?

I tried this but it didn't work,

=IF(G8="","",IF(G8="All",Div,OFFSET(Dept,MATCH(G8, DeptCol,0)-1,1,COUNTIF(DeptCol,G8),1)))


--

Dave Peterson
Reply
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
Lists for List Validation ruthhicks999 Excel Discussion (Misc queries) 2 February 27th 07 02:26 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 12:08 PM
Validation lists Renee Major Excel Discussion (Misc queries) 1 April 25th 06 01:02 AM
Using Lists/Validation Bruce Excel Discussion (Misc queries) 1 March 30th 06 06:28 AM
lists and validation andrewm Excel Worksheet Functions 3 June 23rd 05 08:22 PM


All times are GMT +1. The time now is 01:29 AM.

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"