Date picker control
Open VBA Editor ans select This Workbook in the project browser
Something similar to this in a workbook open event.
Private Sub Workbook_Open() 'Must be this sub name
Dim TodaysDate As Date
Dim TodayFortnightDate As Date
Sheets("ExcelControls").Select 'Use your sheet name
TodaysDate = Date
TodayFortnightDate = Date + 14
Sheets("ExcelControls").CommandButton1.Caption = Format _
(TodaysDate, "dd/mm/yyyy")
Sheets("ExcelControls").CommandButton2.Caption = Format _
(TodayFortnightDate , "dd/mm/yyyy")
End Sub
"GeraldM" wrote:
I have added two date picker controls to a worksheet.
On one control:
I would like to default to today's date whenever the workbook is opened.
On the other control:
I would like to default the date to today + 2 weeks.
How do i set a default value for these controls?
-- Thanks in advance
|