Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What I am trying to do, is use a variable to as part of
the name in a Chart that is created using a macro. When I go Round(takttime, 3), takttime is the variable, and it will round out to 3 decimals as it is supposed to, but I also want it to SHOW THE ZEROS UP TO # DECIMALS. So, for instance, a 5 should show up as 5.000. The problem is, I am not just writing to a cell, so its not like I can just format the cell to 3 decimals and be done with it. Does anyone know how I get this to output to include 0's when rounding? Help is, very much, as always, appreciated! Thanks:) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the Format function:
=Format(Round(taktime,3),"#.000") This converts to Text and specifies the format so it can be assigned to any String variable or to things like the names in your chart, etc. For more info look up the Format function and "User-Defined Numeric Formats" in VBA help. -----Original Message----- What I am trying to do, is use a variable to as part of the name in a Chart that is created using a macro. When I go Round(takttime, 3), takttime is the variable, and it will round out to 3 decimals as it is supposed to, but I also want it to SHOW THE ZEROS UP TO # DECIMALS. So, for instance, a 5 should show up as 5.000. The problem is, I am not just writing to a cell, so its not like I can just format the cell to 3 decimals and be done with it. Does anyone know how I get this to output to include 0's when rounding? Help is, very much, as always, appreciated! Thanks:) . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding time in 24 hour format to produce hours in decimal format | Excel Worksheet Functions | |||
How to type format time in decimal format & calculate | Excel Discussion (Misc queries) | |||
Format percentage as a decimal | Excel Discussion (Misc queries) | |||
Entering numbers with variable decimal places. | Excel Worksheet Functions | |||
variable as Currency two decimal places | Excel Programming |