Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Dates Being displayed the wrong way around.

Hello, Everyone.

I'm having more problems with dates, I'm reading in dates from a
Spreadsheet, and it's swtiching the day and the month around

so the format should be DD/MM/YY (If the order appears Alien it's because
i'm from from the UK )

In my spreadsheet I have 01/05/08

when I read it into the msgBox it displays as 05/01/08

The following code snippit is to show you how I do it.

MsgBox sht.Cells(i, 6).Value

sht is a variant I SET to Sheets("HOLData").



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Dates Being displayed the wrong way around.

Here are some formatting features you might find useful....

Mark Ivey

Note: you can replace the "Range("A1")" with the cell reference you were
using if you prefer



MsgBox Range("A1").Value

MsgBox Format(Range("A1").Value, "MM/DD/YY")
MsgBox Format(Range("A1").Value, "DD/MM/YY")
MsgBox Format(Range("A1").Value, "DDD MM/DD/YYYY")
MsgBox Format(Range("A1").Value, "DDD MMM DD YYYY")
MsgBox Format(Range("A1").Value, "DDD MMMM DD YYYY")

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Dates Being displayed the wrong way around.

Cheers, for some reason a restart fixed the problem :S weird, but I
appreciate the list of different Formats you presented. I shall give them a
whirl.

Thanks again!

"Mark Ivey" wrote:

Here are some formatting features you might find useful....

Mark Ivey

Note: you can replace the "Range("A1")" with the cell reference you were
using if you prefer



MsgBox Range("A1").Value

MsgBox Format(Range("A1").Value, "MM/DD/YY")
MsgBox Format(Range("A1").Value, "DD/MM/YY")
MsgBox Format(Range("A1").Value, "DDD MM/DD/YYYY")
MsgBox Format(Range("A1").Value, "DDD MMM DD YYYY")
MsgBox Format(Range("A1").Value, "DDD MMMM DD YYYY")

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 2007 displayed dates JohnD30 Excel Discussion (Misc queries) 2 December 16th 09 04:39 PM
numbers displayed wrong Richard van Rijsbergen Excel Discussion (Misc queries) 3 July 15th 09 02:26 PM
Wrong number displayed. Bob Excel Discussion (Misc queries) 1 August 14th 07 11:52 PM
negative dates or times are displayed as # # # # Amr Shehata Excel Worksheet Functions 4 February 2nd 07 11:35 AM
negative dates or times are displayed as # # # # Amr Shehata New Users to Excel 3 November 9th 06 12:34 PM


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