View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Numbers of minutes in Verizon Wireless phone bill


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

--
HTH,
Bernie
MS Excel MVP


"Fred Holmes" wrote in message
...
Well, while the single-cell code works, the following attempt to
process a range fails. The code runs, but it produces the value "2"
in every cell in the selected range, no matter what the actual text
number in that cell happens to be.

Thanks for any help,

Fred Holmes

On Wed, 27 Apr 2005 16:46:56 +0100, "Bob Phillips"
wrote:


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