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: 6
Default more newbie help on my significant figures function...

Thanks to all who have already helped with my little significant figures
function. I have ended up with this little function:

Function Sig(Num, Dig)
Sig = WorksheetFunction.Round(Num, Dig - 1 - Int
(WorksheetFunction.Log10(Abs(Num))))
End Function

There is only one thing left for my function to do and I need some help
deciding the best way to go about it.

The one thing my significant figures function does not do is properly add
zeros to the right of a number when needed. For example, the number 5,
when expressed in 3 significant digits, would be 5.00.

Now first I am going to have to make my function determine when it needs
to actually add zeros and then append them, but I assume that even when I
figure out how to do that, I will run into a problem with formatting
since the general format will not show any trailing zeros (yet I don't
want to have to specifiy ahead of time a number formatting with x decimal
places).

So I was thinking one way to do this would be to have my VBA function
determine if zeros need to be added and then change the formatting of the
active cell on the fly to accomodate that number of decimal places. Now
I don't really know exactly how to make all that happen yet, but that is
the direction I am heading.

So basically, before I start figuring out how to do all this, I was
hoping for some feedback regarding my plan. If there are better/easier
ways to achieve this I would like to hear about it.

TIA

James

 
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 show 3 significant figures peter Excel Discussion (Misc queries) 1 February 18th 10 07:51 PM
significant figures Crystal Excel Worksheet Functions 14 July 8th 09 07:36 PM
significant figures? bgarey Excel Discussion (Misc queries) 15 September 3rd 08 08:01 PM
Rounding/Significant figures cloots Excel Worksheet Functions 5 September 1st 05 04:03 PM
pls help newbie with my significant figures function James Bond Excel Programming 5 August 29th 04 11:57 PM


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