> Hi, I need to go through a column of a table and sum all its values.
> Something like in text controls refered as total=total+.textbox.value...how
> to extract the value of a cell.
>
> thanks
> Juan Uribe
Thanks Tony, perfect,
...now I am trying to find out how in VBA is to take away the comma from
strCellText with a builtin function as in VFoxPro without going char by
char...
> > Hi, I need to go through a column of a table and sum all its values.
> > Something like in text controls refered as total=total+.textbox.value...how
[quoted text clipped - 37 lines]
> Cheers
> TonyS.
Tony Strazzeri - 23 Sep 2007 01:46 GMT
Hi Juan,
Yes, that can be tricky. You would expect that using Val would work. But as
you can see below it doesn't.
Dim strNumberString As String 'assuming the value is a string say in
this var
Dim NumVal As Double ' or Single etc
strNumberString = "123,000.23"
NumVal = Val(strNumberString) 'Wrong answer
NumVal = Val(Format(strNumberString, "General Number")) 'right answer
Cheers
TonyS.
> Thanks Tony, perfect,
> ...now I am trying to find out how in VBA is to take away the comma from
[quoted text clipped - 42 lines]
> > Cheers
> > TonyS.