Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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 =----
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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 =----
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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...?


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
Changing time format doodle302 Excel Discussion (Misc queries) 2 January 14th 10 09:56 AM
Pasted values that paste as "number stored as text" smartgal Excel Discussion (Misc queries) 3 July 2nd 08 01:27 AM
Changing a number into time James Excel Discussion (Misc queries) 24 January 13th 08 10:21 PM
Changing format of number without changing the value sweetsue516 Excel Discussion (Misc queries) 2 August 22nd 05 04:07 PM
changing time format JT[_2_] Excel Programming 2 May 17th 04 10:23 PM


All times are GMT +1. The time now is 04:31 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"