+ Reply to Thread
Results 1 to 4 of 4

Thread: Date format not being copied?

  1. #1
    Valued Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Excel 2010
    Posts
    356

    Date format not being copied?

    I am using the following code to post an input record to a database but the date format is not being copied to the database? I am using the same code to copy a different record to another database in the same workbook and the date format is being posted correctly!
    Thanks in advance
    HTML Code: 
    Dim NextRw As Long
        With Sheets("CRM")
            NextRw = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
            Range("CRMInputRecord").Copy
            .Cells(NextRw, 1).PasteSpecial Paste:=xlValues, Paste:=xlFormats, Transpose:=True
        End With
        Application.CutCopyMode = False
        Range("CRMinput").ClearContents
    Last edited by Aland2929; 02-11-2012 at 05:22 AM.

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel 2007
    Posts
    825

    Re: Date format not being copied?

    hi,
    it works fine for me, try to set format-> format cells-> custom dd/mm/yy (or whatever) where you want to paste it.
    Regards, John

  3. #3
    Valued Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Excel 2010
    Posts
    356

    Re: Date format not being copied?

    Thanks a lot. That worked.

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel 2007
    Posts
    825

    Re: Date format not being copied?

    hi Aland,
    thank you for rep! glad it helped you!
    Regards, John

+ 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.2.0