LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default date format change when opening file with vb

Hi,
The 4 is the data type that imports dates in the DMY format. For
instance...

Workbooks.OpenText Filename:="GRAHAM", Origin:=xlWindows _
, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0,
4), Array( _
23, 9), Array(26, 1)

The arrays above are in the form Array(n, m). The n = start position,
the m = data type.

The full list for the data types (m) is...

1 General Data
2 Text
3 MDY
4 DMY
5 YMD
6 MYD
7 DYM
8 YDM
9 Skipped

Therefore, from the first array above:

Array(0, 4) Start position 0 & import as DMY
Array(23, 9) Start position 23 & skip
Array(26, 1) Start position 26 & import as general data

Rob Edwards

Always look on the bright side of life!

*** Sent via Developersdex http://www.developersdex.com ***
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
date format problem from opening dbf file in excel 2007 pol Excel Discussion (Misc queries) 5 December 1st 08 11:42 AM
How do I change the date format when importing a txt file? vpuckett Excel Worksheet Functions 2 November 28th 05 10:53 PM
Opening a csv file with US date format on a Australian PC Troy Lea Excel Discussion (Misc queries) 2 March 16th 05 10:05 PM
switched date format opening dbf file [email protected] Excel Programming 1 July 16th 04 01:13 PM
Date format when opening a .CSV file programmatically jason Excel Programming 3 November 10th 03 09:09 AM


All times are GMT +1. The time now is 07:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"