View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default date drop down box in vba

Here is some code

Sub Jim()
With Range("D1:D12").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="=$M$1:$M$33"
End With
Range("M1").Formula = "=TODAY()"
Range("M2").Formula = "=M1-1"
Range("M2").AutoFill Destination:=Range("M2:M33"), Type:=xlFillDefault
Range("M1:M33").NumberFormat = "ddd dd mmm yyyy"
Columns("D:D").ColumnWidth = 16
Columns("M:M").ColumnWidth = 16
Range("D1:D12") = Date
Range("D1:d12").NumberFormat = "ddd dd mmm yyyy"
Range("D1").Select
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Fuzzy31" wrote in message
...
Hello,
I am new to vba for excel. Ive tried finding the solution in many books

but
was unable.
I need to create date drop down box that will defualt to the current day,
but give the user the option to select another day up to at least 32 days
before the current day. I also need the selected day to appear in seveal
cells in the workbook. And if it is possible to show the day of week next

to
the selected date.
Format mm/dd/yyyy

Thank for your Help

Jim