Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel formula not displaying a number
Hi
I need some some with this macro formula. In excel, the formula is displayed as text and I want it to be a number. There are numbers in the iRow of M, F and N. The problem is the scale factor, I think. I'm tried to change Scale Factor to a number and it still doesn't work. Any suggestions? Dim AlphaT As Long Dim ScaleFactor As String Dim AlphaForm As String If (ws.Cells(iRow, 15).Value = ".1 Scale") Then ScaleFactor = "0.1" If ((ws.Cells(iRow, 11).Value = "XYZ"))Then AlphaT = Abs((ws.Cells(iRow, 13).Value * ws.Cells(iRow, 6).Value) + (ws.Cells(iRow, 14).Value * ScaleFactor)) AlphaForm = "=ABS((M" & iRow & " * F" & iRow & ")+(N" & iRow & " *" & ScaleFactor & "))" End If ws.Cells(iRow, 17).Value = AlphaT ws.Cells(iRow, 17).Formula = AlphaForm |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel formula not displaying a number
What do you want the ScaleFactor to be if the following test is false?
If (ws.Cells(iRow, 15).Value = ".1 Scale") Then ScaleFactor = "0.1" You might consider doing the following: ScaleFactor = "1" If (ws.Cells(iRow, 15).Value = ".1 Scale") Then ScaleFactor = "0.1" MH "jtdunn" wrote in message ... Hi I need some some with this macro formula. In excel, the formula is displayed as text and I want it to be a number. There are numbers in the iRow of M, F and N. The problem is the scale factor, I think. I'm tried to change Scale Factor to a number and it still doesn't work. Any suggestions? Dim AlphaT As Long Dim ScaleFactor As String Dim AlphaForm As String If (ws.Cells(iRow, 15).Value = ".1 Scale") Then ScaleFactor = "0.1" If ((ws.Cells(iRow, 11).Value = "XYZ"))Then AlphaT = Abs((ws.Cells(iRow, 13).Value * ws.Cells(iRow, 6).Value) + (ws.Cells(iRow, 14).Value * ScaleFactor)) AlphaForm = "=ABS((M" & iRow & " * F" & iRow & ")+(N" & iRow & " *" & ScaleFactor & "))" End If ws.Cells(iRow, 17).Value = AlphaT ws.Cells(iRow, 17).Formula = AlphaForm |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel formula not displaying a number
If the actual string always starts with a numeric value, you can use Val.
?val(".1 Scale") 0.1 NickHK "jtdunn" wrote in message ... Hi I need some some with this macro formula. In excel, the formula is displayed as text and I want it to be a number. There are numbers in the iRow of M, F and N. The problem is the scale factor, I think. I'm tried to change Scale Factor to a number and it still doesn't work. Any suggestions? Dim AlphaT As Long Dim ScaleFactor As String Dim AlphaForm As String If (ws.Cells(iRow, 15).Value = ".1 Scale") Then ScaleFactor = "0.1" If ((ws.Cells(iRow, 11).Value = "XYZ"))Then AlphaT = Abs((ws.Cells(iRow, 13).Value * ws.Cells(iRow, 6).Value) + (ws.Cells(iRow, 14).Value * ScaleFactor)) AlphaForm = "=ABS((M" & iRow & " * F" & iRow & ")+(N" & iRow & " *" & ScaleFactor & "))" End If ws.Cells(iRow, 17).Value = AlphaT ws.Cells(iRow, 17).Formula = AlphaForm |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Currency format for Excel 2007 not displaying actual number | Excel Discussion (Misc queries) | |||
displaying complex number in Excel | Excel Discussion (Misc queries) | |||
Displaying large number of pictures in EXCEL | Excel Discussion (Misc queries) | |||
Why is Excel displaying the formula as text | Excel Worksheet Functions | |||
Formula for displaying the lowest number of a range? | Excel Worksheet Functions |