Thread: Q TextToColumns
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Simon Woods[_3_] Simon Woods[_3_] is offline
external usenet poster
 
Posts: 6
Default Q TextToColumns

Hi

I'm converting text to date cells using a combination of NumberFormat and
TextToColumn calls.

However, certain values are not being converted and are remaining, I think,
as text

For example

' ---- format each date column as date
For l_nCol = 1 To .Cols
If .IsDate(l_nCol) Then

' .Format contains formats e.g. mm/yy, dd-mmm-yyyy for
each column

l_oSheet.Columns(l_nCol).NumberFormat = .Format(l_nCol)
l_oSheet.Columns(l_nCol).TextToColumns
FieldInfo:=Array(1, 4)

End If
Next l_nCol

06/10/1998 gets correctly formatted to 06/Oct/1998
but
27/03/1998 doesn't get formatted and remains as it is as text (it is left
justified, whereas converted date values are right justified)

Can someone please explain where I'm going wrong ...

Many thanks

Simon