+ Reply to Thread
Results 1 to 3 of 3

Trouble with date format when making one range equal to another

Hybrid View

  1. #1
    Registered User
    Join Date
    06-04-2009
    Location
    Australia
    MS-Off Ver
    Excel 2002
    Posts
    14

    Trouble with date format when making one range equal to another

    I am using something like this to copy data from one workbook to another

    Set Ws1 = Workbooks("worksheet1.xls").Sheets("Copy From")
    Set Ws2 = Workbooks("worksheet2.xls").Sheets("Copy To")
    Ws2.Range("A1", "K5") = Ws1.Range("A1", "K5").Value
    One of my columns is a date field, formatted using Custom dd/mm/yyyy

    After using this macro the date in the copied data is mm/dd/yyyy even though the receiving cell is formatted the same.... WHY?!?!?
    Last edited by lightsandsirens; 06-18-2009 at 11:58 PM. Reason: solved

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Trouble with date format when making one range equal to another

    Try this:
    Ws2.Range("A1:K5").Value2 = Ws1.Range("A1:K5").Value2
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-04-2009
    Location
    Australia
    MS-Off Ver
    Excel 2002
    Posts
    14

    Re: Trouble with date format when making one range equal to another

    Who would have known that it would be so easy?!?! THANKYOU!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1