ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel2002 autoformats dates, (https://www.excelbanter.com/excel-programming/295817-excel2002-autoformats-dates.html)

bob

Excel2002 autoformats dates,
 
When I use VBA to copy a string from another application
(basiscally this is a screen scrape) if the string is in
the format 12/04/04 (dd/mm/yy) this is entered into a
spreadshett as 04/12/04. 13/04/04 would be unaffected as
either excel or XP knows that 04/13/04 is not a valid
date. I've tried using Cdate and then allocating the
variable the correct format (A=format(b,"dd/mm/yy"))
formating the cell (numberformat ="dd/mm/yy") but it
still does it! I also thought of using Cstr but VBA
interprets the string as a date so that won't work. I've
set my short date format on the machine to match,but no
good. Is my only solution SP3?


All times are GMT +1. The time now is 05:22 PM.

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