Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi
I have 2 cells that I would like to apply the same data validation list to. However, the cells cannot equal each other. How do I apply the list and < both to the cells? Thansk for all replies Melissa |
#2
![]() |
|||
|
|||
![]()
Set up your validation list for both A1 and B1. Then
right-click on the worksheet tab, select "View Code", and paste in the code below. Press ALT+Q to close: Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Application If Intersect(Target, [B1]) Is Nothing Then GoTo CheckA1 .EnableEvents = False With Target If .Value = .Offset(0, -1).Value Then MsgBox "List selections cannot be the same!" .Value = "" End If End With .EnableEvents = True Exit Sub CheckA1: If Intersect(Target, [A1]) Is Nothing Then Exit Sub .EnableEvents = False With Target If .Value = .Offset(0, 1).Value Then MsgBox "List selections cannot be the same!" .Value = "" End If End With .EnableEvents = True End With End Sub --- HTH Jason Atlanta, GA -----Original Message----- Hi I have 2 cells that I would like to apply the same data validation list to. However, the cells cannot equal each other. How do I apply the list and < both to the cells? Thansk for all replies Melissa . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Effect of Conditional Formatting, Data Validation | Excel Discussion (Misc queries) | |||
Pulling data from 1 sheet to another | Excel Worksheet Functions | |||
Data Validation Window? | Excel Discussion (Misc queries) | |||
Excel2K: Is it possible to use dynamic named ranges in custom data validation formula? | Excel Discussion (Misc queries) | |||
data validation on sth else | Excel Worksheet Functions |