ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Import from text file with German Date seperator (https://www.excelbanter.com/excel-programming/351856-import-text-file-german-date-seperator.html)

Crumb

Import from text file with German Date seperator
 
Hi,

I am after a little help with a small problem with date seperators. I
am using a excel VBA to import data from a text file that uses "." as
date seperators, as my regional settings are set to "/" the date
functions will not work.

Here is the part of the code that is causing the problem:

If CDate(TempStartDate) = CDate(beginDate) And CDate(TempStartDate) <=
CDate(endDate) Then .....


i have tried to do the follow change to this code but still get no joy:

If CDate(Replace(TempStartDate, ".", "/")) = CDate(beginDate) And
CDate(Replace(TempStartDate, ".", "/")) <= CDate(endDate) Then


Can any one help me with this before I give in:(

Many Thanks

Ian


Ron de Bruin

Import from text file with German Date seperator
 
Hi Crumb

Start here
http://www.oaltd.co.uk/ExcelProgRef/default.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Crumb" wrote in message oups.com...
Hi,

I am after a little help with a small problem with date seperators. I
am using a excel VBA to import data from a text file that uses "." as
date seperators, as my regional settings are set to "/" the date
functions will not work.

Here is the part of the code that is causing the problem:

If CDate(TempStartDate) = CDate(beginDate) And CDate(TempStartDate) <=
CDate(endDate) Then .....


i have tried to do the follow change to this code but still get no joy:

If CDate(Replace(TempStartDate, ".", "/")) = CDate(beginDate) And
CDate(Replace(TempStartDate, ".", "/")) <= CDate(endDate) Then


Can any one help me with this before I give in:(

Many Thanks

Ian





All times are GMT +1. The time now is 01:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com