Excel - Rounding

Asked By JimatEagl
23-Mar-08 02:51 PM
When, with this,
STaxRate = Application.Round(TTax / SubTotal, 7)
While in code the number is rounded to 7 digits but when posted to a cell in
worksheet it's stored at 16 digits.
How can I get my rounded number to a cell and still be rounded?
Thanks
--
Jim at Eagle
Excel
(1)
Worksheet
(1)
Application.Round
(1)
STaxRate
(1)
NumberFormat
(1)
TTax
(1)
  Jarek Kujawa replied...
24-Mar-08 06:37 AM
try to reformat the cell where STaxRate is stored:

1) by hand, OR

2) name the cell STaxRate and then:

Range("STaxRate").NumberFormat = "0.0000000"
  JimatEagl replied...
23-Mar-08 10:46 PM
Format is fine for appearance. However I want the number to only be 7 digits.
--
Jim at Eagle
  Jim Cone replied...
23-Mar-08 11:03 PM
How are the three variable declared?
What is the value of TTax and SubTotal?
What is the number format of the cell that is receiving the data?
What is the code you use to add the value to the cell?
What version of Excel are you using?

Also, "Subtotal" is not a good name to use for a variable as it is already
used by Excel as a method of the Range object.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



When, with this,
STaxRate = Application.Round(TTax / SubTotal, 7)
While in code the number is rounded to 7 digits but when posted to a cell in
worksheet it's stored at 16 digits.
How can I get my rounded number to a cell and still be rounded?
Thanks
--
Jim at Eagle
Create New Account
help
Win7 VirtualStore Weirdness with Excel 2002 and earlier Excel I thought I'd share a weird experience I had today in case it saves installer for it - - which registers it as an add-in for all installed versions of Excel - - and tested it. Fine in Windows 2000 in all installed versions of Excel. Boot to Windows XP, fine there too. Boot to Windows 7. Fine in Excel 2010, 2007, and 2003. But Excel 2002 and 2000 were still loading the old version of the add-in. I uninstalled the add-in, made sure it was gone, and reinstalled it. Same problem in Excel 2002 and earlier; still works fine in Excel 2003 and later. I opened the VB editor in Excel 2003 and in Excel 2002
32 bit DLL with 64 bit Excel 2010 Excel We have an app which creates large Excel workbooks. For example, one workbook has 1, 000 worksheets. In other cases there are fewer worksheets but the Excel file can be 80 MB or larger. Since this sometimes crashes Excel 2007 and 2003, I am considering using 64 bit Excel 2010. Would 64-bit Excel be more reliable with workbooks this size than 32-bit Excel? Is 32-bit Excel 2010 any more (or less) reliable with large workbooks than Excel
How to strore exact double from macro into Excel cell? Excel I know this is "stoopid" because I am sure I have done this before with I make it work using a macro, other than storing a formula into the cell? - -- -- Excel Programming Discussions Microsoft Excel (1) Office 2010 (1) Excel 2010 (1) Excel 2007 (1) Excel 2003 (1) Excel (1) Word (1) Worksheet (1) Excel keeps track of 15 significant digits when you treat
INT defect: Please try this on 2007 for me Excel Would someone who has Excel 2007 running on an Intel-compatible computer (i.e. not a Mac) please try the examples below and post your results here? I posted this inquiry to an Excel 2010 blog. Not sure if / when I will hear back from them. (Extra credit: If you have Excel 2010 running on an Intel-compatible computer, feel to try these examples and post your results here, too.) Has the following Excel 2003 problem been fixed in 2010 (or 2007)? INT(123456789 - 0.0000004) returns 123456789 instead 493 internally. (The comma demarcates the first 15 significant digits.) So I suspect that the Excel INT algorithm is effectively, albeit perhaps unintentionally, rounding its argument to 15 significant digits before digits - - to determine whether or not to expect a problem. Most people cannot; I can. Excel Worksheet Discussions Excel 2003 (1) Excel 2010 (1) Excel 2007 (1) Office (1) ROUNDDOWN (1) Worksheet
Pb de recalcul Excel Bonjour, J'ai un problème de recalcul de ma feuille excel. J'importe une colonne qui se retrouve en texte 0000 0000 0000 0000 FFF0 7FFF cela soit automatique ? Merci d'avance à ceux qui se pencheront sur mon cas. Caroual Excel - French Discussions WorksheetFunction (1) AddIns (1) Worksheets (1) Excel 2007 (1) Macro (1) Proc (1) LEFT (1) VBA (1) Bonsoir Dans la doc sur 426a74cc@news.free.fr. . . Bonjour, J'ai un probl?me de recalcul de ma feuille excel. J'importe une colonne qui se retrouve en texte 0000 0000 0000 0000 FFF0 7FFF e ou Bonjour, D??butons par une petite explication : Auparavant sous les versions ant??rieures ?? Excel 2007, si les 2 macros compl??mentaires ("utilitaire d'analyse" ou titre d'exemple directement est diff??rente, certains pourraient bien ??prouver des difficult??s. Tous (ou presque) savent qu'Excel sous les versions pr??c??dentes ?? Excel 2007, ne fait pas la traduction des fonctions d'une langue ?? l'autre lorsqu'elles