ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Data Validation Calender Dropdown (https://www.excelbanter.com/excel-programming/309208-data-validation-calender-dropdown.html)

andyp161[_3_]

Data Validation Calender Dropdown
 
Hi there,

Is it possible that, having created a dropdown menu listing dates fro
01/01/04 - 31/12/04, is it possible to programme excel so that th
dropdown menu will always open up on the current date?

Many thank

--
Message posted from http://www.ExcelForum.com


Debra Dalgleish

Data Validation Calender Dropdown
 
The data validation list will default to the item that matches the
cell's value. You could use event code to automatically enter the
current date when the cell is selected.

For example, the following code enter the current date in cell D4. The
code should be stored on the worksheet module (right-click the sheet
tab, choose View Code, and paste the code where the cursor is flashing)--

'================================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$D$4" _
And Target.Value = "" Then
Target.Value = Date
End If
Application.EnableEvents = True
End Sub
'============================

andyp161 < wrote:
Is it possible that, having created a dropdown menu listing dates from
01/01/04 - 31/12/04, is it possible to programme excel so that the
dropdown menu will always open up on the current date?


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com