Thread: Selecting Date
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Selecting Date

You could use Data Validation dropdown to select the date.

On a separate worksheet in A11 enter =TODAY()

In A10 enter =A11 - 1 copy up to A1

In A12 enter =A11 + 1 copy down to A16

Name the range A1:A16 as mydates

On sheet1 select a cell and DataValidationList

In Source enter =mydates

Uncheck error alert so's you can enter a date off the list.

It will only default to Today's date if you use sheet event code like

Private Sub Worksheet_Activate()
Me.Range("D1").Value = Date
End Sub

OR..............

Private Sub Workbook_Open()
Sheets("Sheet1").Range("D1").Value = Date
End Sub

Assumes D1 is the DV dropdown cell.


Gord Dibben MS Excel MVP

On Mon, 4 Jan 2010 14:06:01 -0800, HomeTaught
wrote:

HI
I have a spreadsheet that I want to have a field default to todays date but
if selected I want it to display a selection of dates from 10 days before
todays date to 5 days after todays date. If possible I would like to be able
to add a date outside of this range if necessary. Is this possible? Any help
would be greatly appreciated. Thanks