View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Fred Holmes Fred Holmes is offline
external usenet poster
 
Posts: 112
Default Numbers of minutes in Verizon Wireless phone bill

Even with the below-suggested fix, when I run the code, the value
produced in every cell in the range is "2" regardless of the text
number that is actually in the cell. Running Office 2000 on Win 2000
SP-4 with "all" fixes applied.

Fred Holmes

On Wed, 27 Apr 2005 08:51:29 -0700, "Ed"
wrote:

Fred:

I would use
Dim rng As Range
Dim c As Range
Set rng = Selection
For Each c in rng.Cells

HTH
Ed

"Fred Holmes" wrote in message
.. .
OK, Now I'm trying to do the following:


Sub Convert_to_value_3()
Dim c As Cell
For Each c In Selection
With ActiveCell
.Replace Chr(160), ""
.Value = Val(LTrim(ActiveCell.Value))
End With
Next c
End Sub

"Cell" doesn't work as an object type. If I substitute "Range" for
"Cell" the code will process only the first cell in the selected
Range, not all cells in the selected range.

Many thanks for any help.

Fred Holmes


On Wed, 27 Apr 2005 16:10:34 +0100, "Bob Phillips"
wrote:

Fred,

Try this as well

With ActiveCell
.Replace Chr(160), ""
.Value = Val(LTrim(ActiveCell.Value))
End With