Results 1 to 26 of 26

Imported text 12/8/2017 becomes 8/12/2017

Threaded View

  1. #1
    Forum Contributor terrypin's Avatar
    Join Date
    01-06-2010
    Location
    East Grinstead, UK
    MS-Off Ver
    MS Office 365
    Posts
    548

    Imported text 12/8/2017 becomes 8/12/2017

    Hopefully my illustration describes why I'm baffled by this issue:

    DatePuzzle-01.jpg

    I've shown the import macro below in full. But the problem must arise in the first section, before calling the other three macros which further manipulate the imported text.

    Sub ImportFile_Copy()
    '
    ' ImportFile_Copy Macro
    ' Imports the TXT file _
    ' C:\Users\terry\Dropbox\Excel+VBA (Sundry)\TEMP-VariableList.txt
        
        Workbooks.OpenText Filename:= _
            "C:\Users\terry\Dropbox\Excel+VBA (Sundry)\TEMP-VariableList.txt", Origin:=xlMSDOS, _
            StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
            ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, Comma:=False _
            , Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1)), _
            TrailingMinusNumbers:=True
            
        Windows("TEMP-VariableList.txt").Activate
            
       ' Change size & position
        Application.Left = 782.75
        Application.Top = 1.25
        Application.Width = 658.5
        Application.Height = 879.5
    ' Set col A & B width to 26 & 88 and align both left
        Columns("A:A").ColumnWidth = 26
        Columns("A:A").HorizontalAlignment = xlLeft
        'Columns("B:B").Select
        Columns("B:B").ColumnWidth = 26
        'Selection.ColumnWidth = 88
         Columns("B:B").HorizontalAlignment = xlLeft
    
    Call CopyFromTXTtoTrackData
    Call ConvertToLink
    Call FormatTrackdata
    Cells(1, 1).Select
    
    'Close text file (and Save)
        Windows("TEMP-VariableList.txt").Activate
        ActiveWorkbook.Save
        ActiveWindow.Close
    
    End Sub
    It's almost as if Excel's Import Wizard ignores regional settings and uses the USA standard. And I'm almost certain this was working smoothly a few days ago... Could it be yet another Win 10 WU issue?

    I've spent hours trying in vain to see what's wrong, so help would be much appreciated please!
    Last edited by terrypin; 02-16-2018 at 05:24 PM.
    Terry, East Grinstead, UK
    Excel 365, Win 10 Pro, i7 PC, 4.0 GHz

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 23
    Last Post: 01-03-2022, 10:45 AM
  2. [SOLVED] Format Jan 10, 2017 as 1/10/2017
    By elkhornbabe in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-26-2018, 09:11 AM
  3. Replies: 2
    Last Post: 10-01-2017, 02:38 PM
  4. Replies: 10
    Last Post: 05-13-2017, 01:58 AM
  5. [SOLVED] How to format dates like 9/25/2017 to 09/25/2017
    By chessmonsta in forum Excel General
    Replies: 11
    Last Post: 03-17-2017, 03:11 AM
  6. To all and Excel-lent 2017
    By Keebellah in forum Excel General
    Replies: 1
    Last Post: 01-01-2017, 06:09 AM
  7. Not sure how to explain this but I need to do it about 2017 times!!
    By Andrewm2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-22-2012, 09:54 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