Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Can I get a number in such a format as it should be?

Howday everyone,

Just a quick question here. How can I disable scientific notation to
kick in when manipulating a variable in VBA, i.e. to display/use/...
its value as 123456789123456789 as exactly it should be rather than
1.23E+18. Basically scientific notation needs to be totally switched
off here. The variable is of type Single by the way.

Many thanks
Frank

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Can I get a number in such a format as it should be?

Try the Format() formula. Something like:

Let vMyVar = Format(vMyVar, "00000000000000000.0")

HTH,
tchid2


"OrientalPearl" wrote:

Howday everyone,

Just a quick question here. How can I disable scientific notation to
kick in when manipulating a variable in VBA, i.e. to display/use/...
its value as 123456789123456789 as exactly it should be rather than
1.23E+18. Basically scientific notation needs to be totally switched
off here. The variable is of type Single by the way.

Many thanks
Frank


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Can I get a number in such a format as it should be?

Thanks for the solution, tchid2. The other thing I didn't make clear is
that it's a variable, i.e. its value is unknown, can be 999 or
999999999999999999999999. So Im not exactly sure whether Format() can
do this or not since I dont really know how many 0s I should place
there. Is another more generic way to totally toss scientific notation
out of the window regardless of the number of digits??

Appreciate your help!
Frank

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Can I get a number in such a format as it should be?

I have figured out the solution myself, which is provided here and
hopefully will of some help to others in the futu
It's not complicated really...just need to declare the variable 'AS
Variant', which will keep the numeric representation all the time (well
before its boundary values are exceeded)
Good luck to everyone involved in VBA

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
how do I add phone number format as a permanent custom format? frustratedagain Excel Discussion (Misc queries) 3 February 4th 06 03:52 AM
Replace million-billion number format to lakhs-crores format Sumit Excel Discussion (Misc queries) 1 December 9th 05 04:58 PM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM
Number format based on number format of another cell in another workbook Rob Excel Programming 9 January 9th 05 04:30 PM
excel format cells/Number/Category: Number problem Matts Excel Discussion (Misc queries) 5 December 9th 04 09:47 PM


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