ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   changeing date formats when not intended (https://www.excelbanter.com/excel-programming/331416-changeing-date-formats-when-not-intended.html)

MarkS

changeing date formats when not intended
 
Hi,
I use this piece of code to copy data from one place to another
Range("B" & 11 + (iRowCounter * iCount) & ":D" & 10 + (iRowCounter * (iCount
+ 1))).Value = Worksheets("extract").Range("A16:C" & 15 + iRowCounter).Value

one of the values is a date which is in the dd/mm/yyyy format in the source
but at the destination it is mm/dd/yyyy even when it says it is not.

How do I stop this from happening

MarkS


keepITcool

changeing date formats when not intended
 

have you tried with
Value2 property iso Value?

that way you circumvent dateconversion and or formatting
problems

read vba help on Value2 for specifics



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


MarkS wrote :

Hi,
I use this piece of code to copy data from one place to another
Range("B" & 11 + (iRowCounter * iCount) & ":D" & 10 + (iRowCounter *
(iCount + 1))).Value = Worksheets("extract").Range("A16:C" & 15 +
iRowCounter).Value

one of the values is a date which is in the dd/mm/yyyy format in the
source but at the destination it is mm/dd/yyyy even when it says it
is not.

How do I stop this from happening

MarkS



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

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