Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a dropdown list of Days set in a named range. Is it possible to
set a condition that you can only select a day that is <= to Today? - all via Data Validation |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Assuming A2 is the validated cell, use Custom validation with the
formula =(COUNTIF(daterange,A2)<0)*(A2<=TODAY()) daterange is the range of excel cells that contain admissible dates. HTH Kostis Vezerides On 20 Ιαν, 11:25, Seanie wrote: I have a dropdown list of Days set in a named range. Is it possible to set a condition that you can only select a day that is <= to Today? - all via Data Validation |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks, but is it possible to do with a Drop Down list in A2?
|
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Not if you want a solution involving only DV. You can have List DV
(which gives you the dropdown) and additional valdiation through VBA to test for date <=TODAY(). '------------------------------ Private remembered Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$2" Then If Int(Target.Value) = Int(Now) Then MsgBox "Date must be earlier than today" Target.Value = remembered End If End If End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$2" Then remembered = Target.Value End If End Sub '-------------------------- Right-click on the sheet tab. Choose View COde. Paste the above code in the VBA IDE window that will show up. HTH Kostis On 20 Ιαν, 12:37, Seanie wrote: Thanks, but is it possible to do with a Drop Down list in A2? |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
How about having the DV via a dynamic source range,
display only the valid dates? Assume source dates are listed in Sheet1's A1:A20 In B1: =IF(A1="","",IF(A1<=TODAY(),ROW(),"")) In C1: =INDEX(A:A,SMALL(B:B,ROW())) Copy B1:C1 down to C20 Then create a defined range: MyR to refer to: =OFFSET(Sheet1!$C$1,,,SUMPRODUCT(--ISNUMBER(Sheet1!$C$1:$C$20))) Now you can use MyR as the source in the DVs, and it'll always display only the list of valid dates -- Max Singapore http://savefile.com/projects/236895 Downloads:22,500 Files:370 Subscribers:66 xdemechanik --- "Seanie" wrote in message ... Thanks, but is it possible to do with a Drop Down list in A2? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
DATA VALIDATION LIST- CAN I SELECT FROM LIST WITHOUT SCROLLING | Excel Worksheet Functions | |||
To select from a list | Excel Discussion (Misc queries) | |||
To select from a list | Excel Discussion (Misc queries) | |||
Select from List Box | Excel Worksheet Functions | |||
how to randomly select a name in a list and then the select the ne | Excel Worksheet Functions |