Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input Box default value as a date
1. I want my InputBox to have a default value of a
date,NOW but i keep getting a TYPE mismatch error. 2. I would like the same as #1 but NOW +90 (days). This is what I have: Dim StartDate As Date #1 StartDate = InputBox("Words", "Title", Now(),2) #2 EndDate = InputBox("Words", "Title", Now()+90,2) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input Box default value as a date
Dan
This works...change the format to your locale Sub Test() Dim StartDate As String Dim EndDate As String StartDate = InputBox("Words", "Title", Format(Date, "dd/mm/yyyy")) EndDate = InputBox("Words", "Title", Format(Date + 90, "dd/mm/yyyy")) End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Dan" wrote in message ... 1. I want my InputBox to have a default value of a date,NOW but i keep getting a TYPE mismatch error. 2. I would like the same as #1 but NOW +90 (days). This is what I have: Dim StartDate As Date #1 StartDate = InputBox("Words", "Title", Now(),2) #2 EndDate = InputBox("Words", "Title", Now()+90,2) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Input Box default value as a date
Thanks Nick.
-----Original Message----- Dan This works...change the format to your locale Sub Test() Dim StartDate As String Dim EndDate As String StartDate = InputBox("Words", "Title", Format (Date, "dd/mm/yyyy")) EndDate = InputBox("Words", "Title", Format(Date + 90, "dd/mm/yyyy")) End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England "Dan" wrote in message ... 1. I want my InputBox to have a default value of a date,NOW but i keep getting a TYPE mismatch error. 2. I would like the same as #1 but NOW +90 (days). This is what I have: Dim StartDate As Date #1 StartDate = InputBox("Words", "Title", Now(),2) #2 EndDate = InputBox("Words", "Title", Now()+90,2) . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Turning off the default date input | Excel Discussion (Misc queries) | |||
input a date or update it based on date in another cell | New Users to Excel | |||
default name and value in input cell | Excel Worksheet Functions | |||
Retaining the default in an input box - again | Excel Programming | |||
Retaining a default in an input box | Excel Programming |