Data Validation Calender Dropdown

  • Thread starter Thread starter andyp161
  • Start date Start date
A

andyp161

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
 
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
'============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top