Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NoelH
 
Posts: n/a
Default formating inputbox result in excel

Hi, I have use the inputbox method to seek from the user a date. When the
date 1st Feb 2006 (1/02/2006) is placed into the sheet it shows in the
mm/dd/yy format. I have tried formatting the cell to dd/mm/yy. I know that
there is a way and it has (i think) to do with a special paste function to
allow all dates entered in the inputbox to be in the Australian format
(dd/mm/yy) context. Many thanks in adavance for any help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ken Johnson
 
Posts: n/a
Default formating inputbox result in excel

Hi NoelH,
try this...

Public Sub CorrectDate()
Dim strDate As String
strDate = Application.InputBox("What Date?", 2)
Cells(1, 1) = CDate(strDate)
End Sub

ie, the CDate conversion seems to do the trick.

Fellow Aussie Ken Johnson

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NoelH
 
Posts: n/a
Default formating inputbox result in excel

Hi Ken
Thanks works like a dream.
Noel

"Ken Johnson" wrote:

Hi NoelH,
try this...

Public Sub CorrectDate()
Dim strDate As String
strDate = Application.InputBox("What Date?", 2)
Cells(1, 1) = CDate(strDate)
End Sub

ie, the CDate conversion seems to do the trick.

Fellow Aussie Ken Johnson


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ken Johnson
 
Posts: n/a
Default formating inputbox result in excel

You're welcome Noel.
Thanks for the feedback.

Ken Johnson

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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
How to Convert Figures into Text in Excel m_azim1 Excel Worksheet Functions 3 April 5th 06 05:45 PM
Displays the number in text. (One thousand two hundred thirty four Ashish Patel Excel Worksheet Functions 1 March 20th 06 09:27 PM
Currency to Text mytipi Excel Worksheet Functions 1 February 21st 06 11:43 PM
VBA Monty Excel Worksheet Functions 2 January 30th 06 01:37 PM


All times are GMT +1. The time now is 04:12 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"