LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Odd date parsing issue

Hi there

Here's another I just can't understand.
I am importing a CSV line by line, then using TextToColumns to delimit the
data.
This works fine, leaving dates in column 'A' often in the format 03-Sep-06.
I perform some autofilters on that column, then copy the visible cells to
another sheet
using:
Sheets("Working").UsedRange.Copy Destination:=Sheets("Temp").Range("A1")

Somwehere along the line, Excel parses the date and results in a timeserial
that corresponds to 09/12/06 - such that no matter what date formatting I
use, the date will always be wrong.

Having stepped through the code isolating parts, the code in question is:
Columns(1).TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth,
FieldInfo:=Array(0, 4), TrailingMinusNumbers:=True

The Array(0,4) should specify DMY format, yet it swaps the day / month as
mentioned.

I had inserted this line as the only means I know of to ensure that all
entries in a given column are treated as dates (formatting the column won't
touch string entries etc)... anyone have any useful tips regarding this
action ? Any way of avoiding this for dates where the month / day are
reversible ? I have Date columns with the Date values to the Left AND Right -
I used the above code to convert them to Dates lying to the right... maybe
this is an unnecessary step.
How do you instruct Excel that all values in a column should be treated as
Dates (I had assumed that if this scenario were true the values would align
together on right).

Pointers appreciated
 
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/Time parsing and calculation Terry Pinnell Excel Discussion (Misc queries) 8 May 21st 07 05:59 PM
parsing a date field carriex3 Excel Discussion (Misc queries) 2 August 1st 06 09:30 PM
parsing data - formatting issue terri Excel Discussion (Misc queries) 11 March 6th 06 03:43 PM
Issue with parsing text file into worksheet primrose Excel Programming 1 May 25th 05 05:09 PM
Excel vb running a batch files and parsing output issue Mike S[_3_] Excel Programming 0 June 8th 04 04:43 AM


All times are GMT +1. The time now is 01:28 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"