Consulting

Results 1 to 5 of 5

Thread: Date format problem

  1. #1

    Date format problem

    Hi all,
    I am having a problem with date format it is giving American format 4/12/2013 but I need 12/4/2013 this is the code i have can someone tell me where I can change or what I need to change please.
    Sub date1()
    ThisWorkbook.Sheets("sheet4").Range("c2").Value = "Date"
        For Each c In ThisWorkbook.Sheets("sheet3").Range("a1:a100")
        If c.Value Like "date*" Then ThisWorkbook.Sheets("sheet4").Range("c3").End(xlUp).Offset(1, 0).Value = c.Offset(0, 1).Value
    Next
    cause1
    End Sub

  2. #2
    sorry it is the

    c.Offset(0, 1).Value
    which needs to be formated

  3. #3
    cdate(c.Offset(0, 1).Value)

  4. #4
    Thanks snb it still gave me the same date format
    I tried this however it gave me the time
    CDate(c.Offset(0, 1).Value = Format(Date, "dd/mm/yyyy"))

  5. #5
    VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    c.Offset(0, 1).Value = Format(Date, "dd/mm/yyyy")
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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