Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Round variable to 4 decimal places
Excel Experts,
In my code, I create a variable that I later incorporate into a forumula I enter in a cell. I only want to enter the variable with four decimal places. How would I code this? For example, my code is similar to, Sub EnterBuyPrincipal( ) Dim TPrice As Variant TPrice = 2220/850 Range("A2").FormulaR1C1 = "=100*" & TPrice End Sub The way it is now, the code enters "=100*2.61176470588235". I'm not trying to change the number of decimals displayed, but rather the text of the formula. I want it to read "=100*2.6118". Thanks in advance, Alan -- achidsey |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i round a quotient to specific decimal places? | Excel Worksheet Functions | |||
Subtracting two 2-decimal place numbers gives result 13-decimal places? | Excel Worksheet Functions | |||
Entering numbers with variable decimal places. | Excel Worksheet Functions | |||
ROUND DATA TO 2 DECIMAL PLACES | New Users to Excel | |||
variable as Currency two decimal places | Excel Programming |