Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Return amount with various number of decimals

I have a calculating function in VBA which returns an amount and I have
problems regarding how to show the correct number of decimals.

If the returning value has no decimal, it should show no decimal.
If the returning value has 1 decimal, it should show 1 decimal.
If the returning value has 2 decimals, it should show 2 decimals.
If the returning value has 3 decimals or more, it should show 3
decimals.

How can I solve this?

Regards,

S

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Return amount with various number of decimals

Custom Format Cells as 0.###
--
Charles Chickering

"A good example is twice the value of good advice."


" wrote:

I have a calculating function in VBA which returns an amount and I have
problems regarding how to show the correct number of decimals.

If the returning value has no decimal, it should show no decimal.
If the returning value has 1 decimal, it should show 1 decimal.
If the returning value has 2 decimals, it should show 2 decimals.
If the returning value has 3 decimals or more, it should show 3
decimals.

How can I solve this?

Regards,

S


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Return amount with various number of decimals

format the cell as General.

--
Regards,
Tom Ogilvy


" wrote:

I have a calculating function in VBA which returns an amount and I have
problems regarding how to show the correct number of decimals.

If the returning value has no decimal, it should show no decimal.
If the returning value has 1 decimal, it should show 1 decimal.
If the returning value has 2 decimals, it should show 2 decimals.
If the returning value has 3 decimals or more, it should show 3
decimals.

How can I solve this?

Regards,

S


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Return amount with various number of decimals

format the cell as General and make the column wide enough to display as many
decimals as you would ever expect to see.

--
Regards,
Tom Ogilvy


" wrote:

I have a calculating function in VBA which returns an amount and I have
problems regarding how to show the correct number of decimals.

If the returning value has no decimal, it should show no decimal.
If the returning value has 1 decimal, it should show 1 decimal.
If the returning value has 2 decimals, it should show 2 decimals.
If the returning value has 3 decimals or more, it should show 3
decimals.

How can I solve this?

Regards,

S


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
variable amount truncated regardless of # of decimals Jon Workman[_2_] Excel Programming 0 April 19th 06 06:51 PM
Convert $ amount from excel to access? No decimals but 00 at end Nicole Excel Worksheet Functions 1 January 4th 06 04:37 PM
Conditional formatting : amount of decimals belgian11 Excel Discussion (Misc queries) 0 December 25th 05 04:47 PM
Format monetary amount to 9 digits with No decimals without rounding [email protected] Excel Worksheet Functions 4 December 20th 05 11:14 PM
return decimals only Reidar Excel Discussion (Misc queries) 7 June 24th 05 12:06 PM


All times are GMT +1. The time now is 04:20 PM.

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"