Numbers of minutes in Verizon Wireless phone bill

F

Fred Holmes

I've copy/pasted the web page array of the details of my phone calls
from my on-line verizon cell phone bill into an Excel worksheet. The
number shown for the minutes of duration of each call doesn't equate
to an Excel number and the SUM() function reports zero. What's a line
of code (or other process) that will convert these numeric-appearing
entries into actual numbers? The text in the editing bar is two
spaces followed by a cipher, e.g. " 1" for one minute, so that the
cipher appears just to the right of center.

Neither of the following work. They both convert to the number zero
instead of to the actual number of minutes.

ActiveCell.Value = Val(LTrim(ActiveCell.Value))
ActiveCell.Value = LTrim(ActiveCell.Value)

Using ActiveCell.Text for the right-hand expression also doesn't seem
to work.

The cell formatting in the column has been converted to number, zero
decimal places.

Thanks for any help.

Fred Holmes
 
F

Fred Holmes

These cells in the worksheet are really strange. If I insert another
column alongside the original column and use the N() formula to
extract the number, e.g. N(G12) is the formula in H12, it reports zero
in all instances. ???
 
B

Bob Phillips

Fred,

Try this as well

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


--

HTH

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

Fred Holmes

Oh_Kay. . . !

It works, but why the heck do they do that? Or is it just part of
the code that the html frames use?

Many, many thanks for your help.

Fred Holmes
 
F

Fred Holmes

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
 
B

Bob Phillips

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


--

HTH

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

Bob Phillips

It's done by the HTML, non-breaking spaces used to align data.

--

HTH

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

Ed

Fred:

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

HTH
Ed
 
F

Fred Holmes

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
 
B

Bob Phillips

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)
 
B

Bernie Deitrick

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
 
F

Fred Holmes

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
 
F

Fred Holmes

Earlier message is incorrect. With this change it now works. Al
works.

I modified the wrong code the first time, and had With c instead of
With ActiveCell

Many, Many thanks for all your help.

Fred Homes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top