Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default 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   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 113
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning off the default date input Hanne Excel Discussion (Misc queries) 2 April 30th 08 05:16 PM
input a date or update it based on date in another cell Doug P New Users to Excel 1 July 18th 07 11:25 PM
default name and value in input cell [email protected] Excel Worksheet Functions 4 November 13th 06 04:42 PM
Retaining the default in an input box - again Gordon Humphreys[_2_] Excel Programming 2 August 18th 03 02:28 PM
Retaining a default in an input box Gordon Humphreys[_2_] Excel Programming 1 August 15th 03 02:48 PM


All times are GMT +1. The time now is 07:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"