Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Stop Formatting text as DATES???

I'm trying to automate sending values from an SQL Server database to
an Excel sheet. I don't want Excel to 'translate' these values at
all. I want them to be placed into Excel Cells *exactly as they are
written in the database*.

Here's the situation: This database happens to have a column of
values which read like this, for example:

1-55
1-56

.... In the database in question, these values have nothing to do with
Date values. Nevertheless, Excel is receiving the above text and
automatically treating them as if they *are* date values. For
example, the cells above end up displaying in their Excel cells as

Jan-55
Jan-56

If you click on a cell, you can see in that upper 'bar' area (the
Excel textbox area just to the right of the 'fx' label) that my values
are appearing as:

1/1/1955
1/1/1956

....even though all I programatically entered into the cells were the
'1-55' and '1-56' text values from my database.

How do I STOP Excel from 'interpreting' my incoming values so that the
incoming values are placed *literally* into Excel cells?

Thanks in advance for any/all feedback.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Stop Formatting text as DATES???

Format cell as text. General (on my testing) translates your data to Date as
you have found.

"Alan Mailer" wrote:

I'm trying to automate sending values from an SQL Server database to
an Excel sheet. I don't want Excel to 'translate' these values at
all. I want them to be placed into Excel Cells *exactly as they are
written in the database*.

Here's the situation: This database happens to have a column of
values which read like this, for example:

1-55
1-56

.... In the database in question, these values have nothing to do with
Date values. Nevertheless, Excel is receiving the above text and
automatically treating them as if they *are* date values. For
example, the cells above end up displaying in their Excel cells as

Jan-55
Jan-56

If you click on a cell, you can see in that upper 'bar' area (the
Excel textbox area just to the right of the 'fx' label) that my values
are appearing as:

1/1/1955
1/1/1956

....even though all I programatically entered into the cells were the
'1-55' and '1-56' text values from my database.

How do I STOP Excel from 'interpreting' my incoming values so that the
incoming values are placed *literally* into Excel cells?

Thanks in advance for any/all feedback.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Stop Formatting text as DATES???

Thank you to everyone who has responded so far, but neither formatting
cells as 'General' or 'Text' seem to be giving me what I want.

Using '1-55' as an example of the literal text I want to appear in the
cell. both a 'General' format and a 'Text' format cause this to appear
in the cell:

20090

I'm sorry I didn't mention this in my first message but, for what it's
worth, I'm using Excel 2002.

I'd be open to any more ideas, and thanks again for the ones already
provided.



On Tue, 24 May 2005 03:42:14 -0700, "Toppers"
wrote:

Format cell as text. General (on my testing) translates your data to Date as
you have found.

"Alan Mailer" wrote:

I'm trying to automate sending values from an SQL Server database to
an Excel sheet. I don't want Excel to 'translate' these values at
all. I want them to be placed into Excel Cells *exactly as they are
written in the database*.

Here's the situation: This database happens to have a column of
values which read like this, for example:

1-55
1-56

.... In the database in question, these values have nothing to do with
Date values. Nevertheless, Excel is receiving the above text and
automatically treating them as if they *are* date values. For
example, the cells above end up displaying in their Excel cells as

Jan-55
Jan-56

If you click on a cell, you can see in that upper 'bar' area (the
Excel textbox area just to the right of the 'fx' label) that my values
are appearing as:

1/1/1955
1/1/1956

....even though all I programatically entered into the cells were the
'1-55' and '1-56' text values from my database.

How do I STOP Excel from 'interpreting' my incoming values so that the
incoming values are placed *literally* into Excel cells?

Thanks in advance for any/all feedback.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Stop Formatting text as DATES???

Alan
I had a similar problem:
If I entered 1-55 I got Jan-55 which when I changed the format to TEXT (from
General) I got 20090. If I formatted a cell to text prior to entering the
data, I got 1-55.

I have just tried a custom format of D-YY and that reverts from Jan-55 to
1-55! So perhaps give this a try.

HTH

"Alan Mailer" wrote:

Thank you to everyone who has responded so far, but neither formatting
cells as 'General' or 'Text' seem to be giving me what I want.

Using '1-55' as an example of the literal text I want to appear in the
cell. both a 'General' format and a 'Text' format cause this to appear
in the cell:

20090

I'm sorry I didn't mention this in my first message but, for what it's
worth, I'm using Excel 2002.

I'd be open to any more ideas, and thanks again for the ones already
provided.



On Tue, 24 May 2005 03:42:14 -0700, "Toppers"
wrote:

Format cell as text. General (on my testing) translates your data to Date as
you have found.

"Alan Mailer" wrote:

I'm trying to automate sending values from an SQL Server database to
an Excel sheet. I don't want Excel to 'translate' these values at
all. I want them to be placed into Excel Cells *exactly as they are
written in the database*.

Here's the situation: This database happens to have a column of
values which read like this, for example:

1-55
1-56

.... In the database in question, these values have nothing to do with
Date values. Nevertheless, Excel is receiving the above text and
automatically treating them as if they *are* date values. For
example, the cells above end up displaying in their Excel cells as

Jan-55
Jan-56

If you click on a cell, you can see in that upper 'bar' area (the
Excel textbox area just to the right of the 'fx' label) that my values
are appearing as:

1/1/1955
1/1/1956

....even though all I programatically entered into the cells were the
'1-55' and '1-56' text values from my database.

How do I STOP Excel from 'interpreting' my incoming values so that the
incoming values are placed *literally* into Excel cells?

Thanks in advance for any/all feedback.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Stop Formatting text as DATES???

During your automation, can you add a tick mark to the front of the
text before inserting into Excel?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Stop Formatting text as DATES???

I'm trying to automate sending values from an SQL Server database to
an Excel sheet.

And how are you doing that? Querytable? ADO? ???

--
Regards,
Tom Ogilvy

"Alan Mailer" wrote in message
...
Thank you to everyone who has responded so far, but neither formatting
cells as 'General' or 'Text' seem to be giving me what I want.

Using '1-55' as an example of the literal text I want to appear in the
cell. both a 'General' format and a 'Text' format cause this to appear
in the cell:

20090

I'm sorry I didn't mention this in my first message but, for what it's
worth, I'm using Excel 2002.

I'd be open to any more ideas, and thanks again for the ones already
provided.



On Tue, 24 May 2005 03:42:14 -0700, "Toppers"
wrote:

Format cell as text. General (on my testing) translates your data to Date

as
you have found.

"Alan Mailer" wrote:

I'm trying to automate sending values from an SQL Server database to
an Excel sheet. I don't want Excel to 'translate' these values at
all. I want them to be placed into Excel Cells *exactly as they are
written in the database*.

Here's the situation: This database happens to have a column of
values which read like this, for example:

1-55
1-56

.... In the database in question, these values have nothing to do with
Date values. Nevertheless, Excel is receiving the above text and
automatically treating them as if they *are* date values. For
example, the cells above end up displaying in their Excel cells as

Jan-55
Jan-56

If you click on a cell, you can see in that upper 'bar' area (the
Excel textbox area just to the right of the 'fx' label) that my values
are appearing as:

1/1/1955
1/1/1956

....even though all I programatically entered into the cells were the
'1-55' and '1-56' text values from my database.

How do I STOP Excel from 'interpreting' my incoming values so that the
incoming values are placed *literally* into Excel cells?

Thanks in advance for any/all feedback.




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
Stop automatic formatting of cells (number, text, date, etc) Marcela Excel Worksheet Functions 4 June 9th 08 08:09 PM
Is it possible to get Excel to stop formatting text as a date? PeteeWJ Excel Discussion (Misc queries) 2 May 12th 08 06:28 PM
Formatting dates with =TEXT() Idoia Excel Discussion (Misc queries) 1 January 8th 08 05:41 PM
How do I stop Excel auto formatting the text 3-4 as 04 Apr? ahughf Excel Discussion (Misc queries) 3 October 16th 05 10:58 AM
How do I stop auto converting Text(Inventory#) to Dates DavidB Excel Discussion (Misc queries) 1 September 2nd 05 05:14 PM


All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"