+ Reply to Thread
Results 1 to 4 of 4

Please Help...Date converting to USA from UK when running Macro !!!

  1. #1
    Registered User
    Join Date
    07-17-2006
    Posts
    3

    Please Help...Date converting to USA from UK when running Macro !!!

    Hi

    Below is the code from a macro I am running in Excel.

    The prolem is that once the file is saved the dates are converted into USA format from UK format and this is causing major problems..

    Would appreciate any help please...

    Sub format()
    '
    ' format Macro
    ' format for data load
    '

    '
    ActiveWorkbook.Save
    ActiveSheet.Unprotect
    Rows("1:11").Select
    Selection.Delete Shift:=xlUp
    Columns("B:B").Select
    Selection.ClearContents
    ActiveWorkbook.SaveAs Filename:="c:\payroll\Cleaners.csv", _
    FileFormat:=6, CreateBackup:=False
    ActiveWorkbook.Close Savechanges:=False
    End Sub



    Thanks

    Paddy

  2. #2
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667

    UK Date

    Dates are recorded as a number; today is 38915! The presentation is a question of format, either in Excel or Windows (Local settings).
    By the way the code you have posted does not seem to directly involve dates.
    Best regards,

    Ray

  3. #3
    Registered User
    Join Date
    07-17-2006
    Posts
    3
    Quote Originally Posted by raypayette
    Dates are recorded as a number; today is 38915! The presentation is a question of format, either in Excel or Windows (Local settings).
    By the way the code you have posted does not seem to directly involve dates.
    Sorry, the code is part of the macro....this macro is to convert an excel file into a csv file and it is the dates within the files that are being changed from a UK format to a USA one...

    Any help is appreciated....
    Paddy

  4. #4
    Registered User
    Join Date
    07-17-2006
    Posts
    3

    Smile

    Quote Originally Posted by padmaster
    Sorry, the code is part of the macro....this macro is to convert an excel file into a csv file and it is the dates within the files that are being changed from a UK format to a USA one...

    Any help is appreciated....
    Paddy

    Sorted !!!

    Range("c:c").NumberFormat = "dd/mm/yyyy"

    Where c:c is the range

    This ensures the format is correct in the macro...

    Thanks for all your help.

+ 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