View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Wayne Nelson Wayne Nelson is offline
external usenet poster
 
Posts: 1
Default Another Date Format issue


Hi,
I'm new to this forum and find it very useful. Thanks to all those wh
give advise and to all those who ask questions.
I have another date issue. The date is entered in an Input box. Th
variable is formated as "dd/mm/yy". The Excel spreadsheet and th
regional seetings are set to the same.
However if the first 2 numbers entered in the input box are less tha
13, VBA assumes its a month. The value becomes "mm/dd/yy"
ie Enter 12/10/03, output as 10/12/03
If the first 2 numbers are 12, the correct date is entered in th
Excel spreadsheet.
ie Enter 21/10/03; output as 21/10/03.

Code as follows: ComD = InputBox("Please enter " & CtlNm & " Completio
Date.", "COMPLETION DATE:")

RepDa.Cells(Rw, 7).Value = Format(ComD, "dd/mm/yyyy"

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements