LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default FormatProblem

Range("A1").Value = "'" & "1234432156788765"

or if you mean splitting it apart:

myVal= "1234432156788765"
or MyVal = Range("A2").Text

Range("A4") = _
MID(myVal,1,4) & " " & MID(myval,5,4) & " " & _
MID(myVal,9,4) & " " & MID(MyVal,13,4)

--
Regards,
Tom Ogilvy


"jb" wrote in message
...
Tom:

Is there a way to do this with VBA, I have several thousand numbers?

TIA

Tom Ogilvy wrote:
I entered you number with a leading single quote

'1234432156788765

And your formula worked fine for me. You can't store a number with 16
digits - 15 is the max, so you have to store it as text. You can't make

it
text after you enter it as a number by changing the formatting. To be
absolutely sure it is interpreted as text, use the leading single quote.




 
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



All times are GMT +1. The time now is 11:46 PM.

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"