View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Numbers of minutes in Verizon Wireless phone bill

Sorry, missed a bit

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


--

HTH

RP
(remove nothere from the email address if mailing direct)


"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