Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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
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
Currency format for Excel 2007 not displaying actual number gaelic_vixen Excel Discussion (Misc queries) 1 December 13th 07 02:17 PM
displaying complex number in Excel YK Excel Discussion (Misc queries) 2 October 3rd 07 09:36 PM
Displaying large number of pictures in EXCEL [email protected] Excel Discussion (Misc queries) 1 June 8th 07 01:09 PM
Why is Excel displaying the formula as text Richard Excel Worksheet Functions 0 November 29th 06 02:38 PM
Formula for displaying the lowest number of a range? coal_miner Excel Worksheet Functions 1 April 25th 05 02:54 PM


All times are GMT +1. The time now is 03:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"