Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 791
Default Sort imported date column

I exported a CSV file from one of my on-line accounts. The file has a list
of names, account numbers, and dates. Although the cells containing dates
are formatted as dates in the Format Cells-Number-Date, the sorting function
does not recognize that and will not sort oldest to newest. If I manually
retype a few of the dates into another column, Excel recognizes those as
being dates with no trouble. Is there something about importing from a CSV
that would cause this behavior?
Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Sort imported date column

Try this after selecting the range with your dates

Sub fixmynums()
Application.ScreenUpdating = False
'lr = Cells.SpecialCells(xlCellTypeLastCell).Row
On Error Resume Next
For Each C In Selection 'Range("a1:q" & lr)
If Trim(Len(C)) 0 And C.HasFormula = False Then
C.NumberFormat = "General"
C.Value = CDbl(C)
End If
Next

Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Michael" wrote in message
...
I exported a CSV file from one of my on-line accounts. The file has a list
of names, account numbers, and dates. Although the cells containing dates
are formatted as dates in the Format Cells-Number-Date, the sorting
function
does not recognize that and will not sort oldest to newest. If I manually
retype a few of the dates into another column, Excel recognizes those as
being dates with no trouble. Is there something about importing from a
CSV
that would cause this behavior?
Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 791
Default Sort imported date column

Don,

I'm sorry to say that I am not a programmer, so I didn't understand what you
are saying. Consequently, I have no way to implement your suggestion, as I
don't know where to begin. Thank you.

Mike

"Don Guillett" wrote:

Try this after selecting the range with your dates

Sub fixmynums()
Application.ScreenUpdating = False
'lr = Cells.SpecialCells(xlCellTypeLastCell).Row
On Error Resume Next
For Each C In Selection 'Range("a1:q" & lr)
If Trim(Len(C)) 0 And C.HasFormula = False Then
C.NumberFormat = "General"
C.Value = CDbl(C)
End If
Next

Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Michael" wrote in message
...
I exported a CSV file from one of my on-line accounts. The file has a list
of names, account numbers, and dates. Although the cells containing dates
are formatted as dates in the Format Cells-Number-Date, the sorting
function
does not recognize that and will not sort oldest to newest. If I manually
retype a few of the dates into another column, Excel recognizes those as
being dates with no trouble. Is there something about importing from a
CSV
that would cause this behavior?
Thank you.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 320
Default Sort imported date column

What does the date look like? If it's something like 20080826, you can select
that column, use Data/text to columns, in step 3 change the column Format to
Date & select YMD, then click Finish

"Michael" wrote:

I exported a CSV file from one of my on-line accounts. The file has a list
of names, account numbers, and dates. Although the cells containing dates
are formatted as dates in the Format Cells-Number-Date, the sorting function
does not recognize that and will not sort oldest to newest. If I manually
retype a few of the dates into another column, Excel recognizes those as
being dates with no trouble. Is there something about importing from a CSV
that would cause this behavior?
Thank you.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 791
Default Sort imported date column

Bob,

When I select a cell in the imported column and choose Properties, it is
formatted as a date. The same holds true for the the cell in which I
manually inserted a date. You would think that a plain CSV wouldn't confuse
Excel, especially when I can "tell" it that the column is a series of dates.

Mike

"Bob Umlas, Excel MVP" wrote:

What does the date look like? If it's something like 20080826, you can select
that column, use Data/text to columns, in step 3 change the column Format to
Date & select YMD, then click Finish

"Michael" wrote:

I exported a CSV file from one of my on-line accounts. The file has a list
of names, account numbers, and dates. Although the cells containing dates
are formatted as dates in the Format Cells-Number-Date, the sorting function
does not recognize that and will not sort oldest to newest. If I manually
retype a few of the dates into another column, Excel recognizes those as
being dates with no trouble. Is there something about importing from a CSV
that would cause this behavior?
Thank you.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Sort imported date column

Just because it is formatted as a date does not mean Excel recognizes it as
a date.

Try Bob's Text to Columns. Should convert to real dates.


Gord Dibben MS Excel MVP

On Tue, 16 Sep 2008 12:09:02 -0700, Michael
wrote:

Bob,

When I select a cell in the imported column and choose Properties, it is
formatted as a date. The same holds true for the the cell in which I
manually inserted a date. You would think that a plain CSV wouldn't confuse
Excel, especially when I can "tell" it that the column is a series of dates.

Mike

"Bob Umlas, Excel MVP" wrote:

What does the date look like? If it's something like 20080826, you can select
that column, use Data/text to columns, in step 3 change the column Format to
Date & select YMD, then click Finish

"Michael" wrote:

I exported a CSV file from one of my on-line accounts. The file has a list
of names, account numbers, and dates. Although the cells containing dates
are formatted as dates in the Format Cells-Number-Date, the sorting function
does not recognize that and will not sort oldest to newest. If I manually
retype a few of the dates into another column, Excel recognizes those as
being dates with no trouble. Is there something about importing from a CSV
that would cause this behavior?
Thank you.


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 791
Default Sort imported date column

I tried that to no avail. However, "Paste Special" worked. I should have
thought about that. Thanks to all.

"Gord Dibben" wrote:

Just because it is formatted as a date does not mean Excel recognizes it as
a date.

Try Bob's Text to Columns. Should convert to real dates.


Gord Dibben MS Excel MVP

On Tue, 16 Sep 2008 12:09:02 -0700, Michael
wrote:

Bob,

When I select a cell in the imported column and choose Properties, it is
formatted as a date. The same holds true for the the cell in which I
manually inserted a date. You would think that a plain CSV wouldn't confuse
Excel, especially when I can "tell" it that the column is a series of dates.

Mike

"Bob Umlas, Excel MVP" wrote:

What does the date look like? If it's something like 20080826, you can select
that column, use Data/text to columns, in step 3 change the column Format to
Date & select YMD, then click Finish

"Michael" wrote:

I exported a CSV file from one of my on-line accounts. The file has a list
of names, account numbers, and dates. Although the cells containing dates
are formatted as dates in the Format Cells-Number-Date, the sorting function
does not recognize that and will not sort oldest to newest. If I manually
retype a few of the dates into another column, Excel recognizes those as
being dates with no trouble. Is there something about importing from a CSV
that would cause this behavior?
Thank you.



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 320
Default Sort imported date column

What does the date look like? If it's something like 20080826, you can select
that column, use Data/text to columns, in step 3 change the column Format to
Date & select YMD, then click Finish

"Michael" wrote:

I exported a CSV file from one of my on-line accounts. The file has a list
of names, account numbers, and dates. Although the cells containing dates
are formatted as dates in the Format Cells-Number-Date, the sorting function
does not recognize that and will not sort oldest to newest. If I manually
retype a few of the dates into another column, Excel recognizes those as
being dates with no trouble. Is there something about importing from a CSV
that would cause this behavior?
Thank you.

Reply
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
rec'd imported "date,value" in one column how do I separate? FL_Geezer Excel Discussion (Misc queries) 1 October 13th 07 08:15 PM
how to sort a column containing date of birth? ian borg Excel Discussion (Misc queries) 1 April 17th 07 12:52 AM
Keeping Imported Picture in Cell During Sort Big John Aggie Excel Discussion (Misc queries) 0 January 11th 06 08:48 PM
Sort order : Excel vs imported data John Excel Discussion (Misc queries) 0 December 9th 05 01:40 PM
sort column in date order dd/mm/yy K Excel Discussion (Misc queries) 3 April 13th 05 09:00 PM


All times are GMT +1. The time now is 05:31 PM.

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"