View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Terry Pinnell[_4_] Terry Pinnell[_4_] is offline
external usenet poster
 
Posts: 192
Default Day & Month reversed when importing text

Hopefully my illustration describes why I'm baffled:

https://www.dropbox.com/s/sb8wkiypq9...le-01.jpg?dl=0

The problem must arise in this first section, before calling 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
etc

It's almost as if Excel's Import Wizard totally 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?

Terry, East Grinstead, UK