Results 1 to 6 of 6

Issue when copying cells (defaults to mm/dd/yyyy when im wanting dd/mm/yyyy)

Threaded View

  1. #1
    Registered User
    Join Date
    12-15-2014
    Location
    UK
    MS-Off Ver
    2010
    Posts
    18

    Issue when copying cells (defaults to mm/dd/yyyy when im wanting dd/mm/yyyy)

    Hello All,

    I have some code below that looks for any changes and finds the match on the other sheet and updates any changes, however the dates when transferred over go from the UK formatiing of dd/mm/yyyy to the US style date of mm/dd/yyyy making all the dates in the sheet incorrect.

    Could someone help and advise how I make it stay the same way? Thanks!"


    Dim s1rw As Long, s2rw As Long, col As Long, endcol As Long
    
        Sheets("Sheet1").Select
        With Sheets("Sheet2")
            s2rw = 2 ' Adjust to first data row #
            endcol = .Cells(s2rw - 1, 1).End(xlToRight).Column
            Do Until .Cells(s2rw, 1).Value = "" ' Loop through case #s
                s1rw = 0
                On Error Resume Next
                s1rw = Cells.Find(What:=.Cells(s2rw, 1).Value, LookIn:=xlFormulas, LookAt:=xlWhole).Row
                On Error GoTo 0
                If s1rw > 0 Then ' Found case #
                    For col = 1 To endcol ' Loop through columns
                        If Cells(s1rw, col).Value <> "" Then
                            .Cells(s2rw, col).Value = Cells(s1rw, col).Value
                        End If
                      Next
                End If
              Rows(s2rw).Delete
                s2rw = s2rw + 1
            Loop
            .Select
        End With
    Last edited by markpem; 12-22-2014 at 07:35 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Issue in macro to convert date from DD-MON-YYYY into YYYY-MON-DD
    By abraham30 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2014, 09:17 AM
  2. Replies: 7
    Last Post: 11-18-2012, 02:28 PM
  3. [SOLVED] Imported data contains strings dd.mm.yyyy how can I convert to date format dd/mm/yyyy inVB
    By Boormo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2012, 05:48 PM
  4. Copy+Paste macro dd/mm/yyyy to dd/mm/yyyy and NOT dd/mm/yyyy to mm/dd/yyyy
    By uimhirADo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2012, 03:45 AM
  5. [SOLVED] opening excel file -> date format problem: DD/MM/YYYY vs MM/DD/YYYY
    By yung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2005, 09:06 AM

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