Hi Jaf
Place a Combobox from the Control Toolbox on your sheet. Double click it and add this code.
Private Sub ComboBox1_Change()
If ComboBox1.ListIndex > -1 Then
ComboBox1 = Format(ComboBox1, "dd/mm/yyyy")
[A2] = ComboBox1
End If
End Sub
Private Sub ComboBox1_LostFocus()
Dim LastRw As Range
Dim FirstRw As Range
Dim ListRange As String
Application.DisplayAlerts = False
Application.ScreenUpdating = False
On Error Resume Next
Sheets.Add().Name = "LISTSHEET"
If ActiveSheet.Name <> "LISTSHEET" Then ActiveSheet.Delete
Range("MyList").Clear
On Error GoTo 0
Set FirstRw = ActiveSheet.Columns(1).Find _
(What:="*/*/*", after:=[A1])
Set LastRw = [A65536].End(xlUp)
With Range(FirstRw, LastRw)
.AdvancedFilter _
Action:=xlFilterInPlace, Unique:=True
.SpecialCells(xlCellTypeVisible).Copy _
Destination:=Sheets("LISTSHEET").Range("A1")
End With
ActiveSheet.ShowAllData
With Sheets("LISTSHEET")
ListRange = .Range("A1").CurrentRegion.Address
ActiveWorkbook.Names.Add _
Name:="MyList", RefersTo:="=LISTSHEET!" & ListRange
.Visible = xlVeryHidden
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
ComboBox1.ListFillRange = "MyList"
[A2].NumberFormat = "dd/mm/yyyy"
End Sub
You may need to change the date format and the "*/*/*" within the Find to the type of date seperator your PC has in it's regional settings.
Hope this helps
dave
OzGrid Business Applications