Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default inputbox date format



thismonth = CDate(Application.InputBox(prompt:="Enter the Current Month",
Title:="Select Date"))

i want the user to be able to input in mmm-yy format, e.g may-09. But when
may-09 is entered, for example, thismonth becomes 09/05/09. Why and how can i
get around this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default inputbox date format

CDate converts this to a date in your system date time format.. You can use
the Format function to display/use this...If you are looking at putting this
back to a cell; then input to the cell as it is and format the cell to mmm-yy

Dim thismoonth As Variant

thismonth = CDate(Application.InputBox(prompt:="Enter the Current Month", _
Title:="Select Date", Default:=Format(Date, "mmm-yy")))
MsgBox Format(thismonth, "mmm-yy")

If this post helps click Yes
---------------
Jacob Skaria


"PBcorn" wrote:



thismonth = CDate(Application.InputBox(prompt:="Enter the Current Month",
Title:="Select Date"))

i want the user to be able to input in mmm-yy format, e.g may-09. But when
may-09 is entered, for example, thismonth becomes 09/05/09. Why and how can i
get around this?

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
Format prompt in VB InputBox Patrick14 Excel Programming 2 June 10th 06 11:35 PM
Make date entered in an InputBox UK format Co-op Bank Excel Programming 5 April 10th 06 04:19 PM
inputbox uk date tina Excel Programming 4 April 4th 06 10:44 AM
Inputbox as Date andibevan Excel Programming 3 July 9th 04 02:15 PM
Date from InputBox Michael Excel Programming 3 May 26th 04 01:11 PM


All times are GMT +1. The time now is 11:49 PM.

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"