ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasted values keep changing to time number format (https://www.excelbanter.com/excel-programming/383543-pasted-values-keep-changing-time-number-format.html)

Arch Stanton

Pasted values keep changing to time number format
 
I'm trying to paste concatenated values to cells on a spreadsheet using
this formula:

ActiveCell.Value = ActiveCell.Offset(0, 5).Value & " - " &
ActiveCell.Offset(0, 6).Value

But when a concatenated value that looks like a date gets pasted into a
cell, the cell turns it into a date. For instance, if my formula pastes
"4 - 72" into a cell, Excel changes it into Apr-4. I've tried turning
the values into strings, adding spaces, etc., but Excel always turns my
pasted values into dates.

I feel like a dolt for asking this, and I've been through the help
utility and Googled it, but I just can't work out how to suppress the
autoformat function, or whatever that is.

Thanks for any help.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Jim Cone

Pasted values keep changing to time number format
 

Try this line just before you transfer the values...
ActiveCell.NumberFormat = "@"
'--
Your name seems familiar...?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Arch Stanton"
wrote in message
I'm trying to paste concatenated values to cells on a spreadsheet using
this formula:
ActiveCell.Value = ActiveCell.Offset(0, 5).Value & " - " &
ActiveCell.Offset(0, 6).Value

But when a concatenated value that looks like a date gets pasted into a
cell, the cell turns it into a date. For instance, if my formula pastes
"4 - 72" into a cell, Excel changes it into Apr-4. I've tried turning
the values into strings, adding spaces, etc., but Excel always turns my
pasted values into dates.

I feel like a dolt for asking this, and I've been through the help
utility and Googled it, but I just can't work out how to suppress the
autoformat function, or whatever that is.
Thanks for any help.

Arch Stanton

Pasted values keep changing to time number format
 

Jim, this worked great. I'll keep the name Primitive Software in my
mental Rolodex in case I run across anyone who needs it.

You should watch "The Good, The Bad, and The Ugly" again. Seriously,
it's a better movie than you remember. (You've seen it before, I gather,
which is why my internet pseudonym is familiar).

Thanks again, amigo.

AS


Jim Cone wrote:

Try this line just before you transfer the values...
ActiveCell.NumberFormat = "@"
'--
Your name seems familiar...?


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Jim Cone

Pasted values keep changing to time number format
 

I remember it as a good movie.
That was the name on the headstone where the treasure was buried.
Thanks, because without your hint I would still be wondering if
maybe I went to school with you. <g
Jim Cone


"Arch Stanton"
wrote in message
Jim, this worked great. I'll keep the name Primitive Software in my
mental Rolodex in case I run across anyone who needs it.

You should watch "The Good, The Bad, and The Ugly" again. Seriously,
it's a better movie than you remember. (You've seen it before, I gather,
which is why my internet pseudonym is familiar).
Thanks again, amigo.
AS


Jim Cone wrote:
Try this line just before you transfer the values...
ActiveCell.NumberFormat = "@"
'--
Your name seems familiar...?




All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com