LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Number stored as text. How do I keep the number format?


Hi, all.

I came across a problem when trying to put a value from one cell t
another.
Here goes a sample code.

=======================
Sub aaa()
Dim rng_src as range

Set rng_src = activecell
activecell.offset(1,0).value = rng_src.value
activecell.offset(1,0).NumberFormat = rng_src.NumberFormat

End Sub
=======================

It works fine with regular numeric or string values, but gets ver
frustrating when the source cell is "number stored as text", whethe
the cell format was overriden with an apostrophe or it was value-copie
from such ranges.

I can't find anything in the vba help file or the object browser.

Is there any way to work around this pain in the 's' , other tha
PasteSpecial method?

Thanks a lot

--
stayin
-----------------------------------------------------------------------
staying's Profile: http://www.excelforum.com/member.php...fo&userid=2323
View this thread: http://www.excelforum.com/showthread.php?threadid=55088

 
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
Number stored as text Ana via OfficeKB.com Excel Worksheet Functions 3 October 14th 09 01:05 PM
Number stored as text GKW in GA Excel Discussion (Misc queries) 3 August 14th 08 05:53 PM
Number stored as text Prashwee Excel Programming 3 March 15th 06 11:22 AM
Number stored as text Andrew Clark Excel Discussion (Misc queries) 1 November 8th 05 10:25 PM
Number stored as text sueanne Excel Discussion (Misc queries) 1 March 2nd 05 10:56 PM


All times are GMT +1. The time now is 09:39 AM.

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

About Us

"It's about Microsoft Excel"