Why this paste result?

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.
 
C

Claus Busch

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.
 
G

GS

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
 
G

GS

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
 
T

Terry Pinnell

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top