LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default VB converting UK to US dates, randomly, ignores cdate func!

Written macro which processes csv files - splits into +ve & -ve values of one
colum, sorts, adda couple of calculated columns. One of the cols (col index
5) is a date: dd/mm/yyyy, however excel is randomly converting some of these
to american format. Using CDATE fuction makes no difference. The last step in
the macro is the following code to attempt to correct this:
-----------------------------------------------
with workbooks(workbookobjectname)

For Each w In .Worksheets

For i = 2 To w.UsedRange.Rows.Count
w.Cells(i, 5) = CDate(DateSerial(Year(w.Cells(i, 5)), Month(w.Cells(i,
5)), Day(w.Cells(i, 5))))
Next i

Next w

end with

-------------------------------

This does not work - why? Help appreciated.

Thanks

 
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
Cdate does not help jodleren Excel Programming 2 March 19th 10 11:49 AM
Converting Julian Dates to regular dates CDTucson Excel Worksheet Functions 2 June 7th 07 04:20 AM
Converting Text dates into dates EAB1977 Excel Programming 2 January 20th 06 04:20 PM
VBA Function that ignores dates in a Holiday Table Sorbit Excel Worksheet Functions 0 January 17th 06 10:03 PM
CDate and IsDate Geoff Excel Programming 3 June 4th 05 02:20 PM


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