Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dates exported as text


I am running Sage in the UK and when I export a report the dates are
exported as text.

I then need to change the format to "dd/mm/yy" - select the cell and
then press enter.

I have written some VBA code to automate this - but it does not work on
dates such as 25th March 2005 - because Excel thinks that 25 is the
month and 3 is the day.

Has anyone experienced a similar problem - Is there a solution?

Many Thanks,
Michael


--
michael.a7
------------------------------------------------------------------------
michael.a7's Profile: http://www.excelforum.com/member.php...o&userid=33027
View this thread: http://www.excelforum.com/showthread...hreadid=528494

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Dates exported as text

Hi
Excel doesn't like the th or rd in 24th or 23rd.
In VBA you could try

Public Sub test()
With Application.WorksheetFunction
Range("C1").Value =
Format(DateValue(.Substitute(.Substitute(Range("A1 "), "th", ""), "rd",
"")), "dd/mm/yy")
End With
End Sub

mind the line wrap. Your original date is in A1.

In Excel try
=DATEVALUE(SUBSTITUTE(SUBSTITUTE(A1, "th", ""), "rd", ""))

in cell C1, say, where C1 has the general cell format. Now change the
cell format to date and choose the format you require

regards
Paul

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dates exported as text


Thanks Paul :

--
michael.a
-----------------------------------------------------------------------
michael.a7's Profile: http://www.excelforum.com/member.php...fo&userid=3302
View this thread: http://www.excelforum.com/showthread.php?threadid=52849

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
Columns formatted As Dates Are Exported as a Number to Text Rich Locus Excel Discussion (Misc queries) 1 February 7th 10 08:00 PM
Data from exported file read as text, when edited becomes a # (pic Jarod Excel Discussion (Misc queries) 1 July 1st 09 02:21 AM
Exported from Access - text has a character before it Brian Excel Discussion (Misc queries) 0 January 31st 08 06:22 PM
Need quotes around exported tab delimited text Carol Grismore Excel Discussion (Misc queries) 0 May 17th 06 06:19 PM
why are there quotes in my exported text file? Gordon Excel Discussion (Misc queries) 2 February 16th 05 06:59 PM


All times are GMT +1. The time now is 03:25 AM.

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

About Us

"It's about Microsoft Excel"