Why this paste result?

  • Thread starter Thread starter Terry Pinnell
  • Start date Start date
T

Terry Pinnell

I have a text file containing lines
3-01
3-02
3-03
etc

On copy/pasting these into an empty column (in Excel 2002) they were
displayed as

03-Jan
03-Feb
03-Mar
etc

First, I don't really understand why. That column was not formatted
for dates. More important, I don't see why specifying General or Text
doesn't now get them displayed correctly?

Any advice would be appreciated please.
 
Hi Terry,

Am Thu, 09 Oct 2014 11:35:03 +0100 schrieb Terry Pinnell:
I have a text file containing lines
3-01
3-02
3-03
etc

On copy/pasting these into an empty column (in Excel 2002) they were
displayed as

03-Jan
03-Feb
03-Mar
etc

3-01 is the short style to write a date.
Format your cells as text before pasting or open Excel => Data =>
External Data from Text and choose in the 3. step of the assistent for
the expected column the format "Text"


Regards
Claus B.
 
I have a text file containing lines
3-01
3-02
3-03
etc

On copy/pasting these into an empty column (in Excel 2002) they were
displayed as

03-Jan
03-Feb
03-Mar
etc

First, I don't really understand why. That column was not formatted
for dates. More important, I don't see why specifying General or Text
doesn't now get them displayed correctly?

Any advice would be appreciated please.

Cell format is 'General' by default and so Excel interprets input as
such. Since your text is valid 'date' format in Excel, it gets
interpreted as a date.

When Excel pastes text into a cell already formatted as text then it
displays same as in the text format. Changing cell format *after*
pasting does nothing. Setting cell format to 'Text' *before* pasting
results in what you want.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
Since your OS is XP (or earlier), the system date format (default)
is...

d-m-y

On later OSs, this has been changed to...

m-d-y

Note that year is assumed as the current calendar year.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
Claus Busch said:
Hi Terry,

Am Thu, 09 Oct 2014 11:35:03 +0100 schrieb Terry Pinnell:


3-01 is the short style to write a date.
Format your cells as text before pasting or open Excel => Data =>
External Data from Text and choose in the 3. step of the assistent for
the expected column the format "Text"


Regards
Claus B.

Thanks both, appreciate the fast replies.
 
Back
Top