ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   char to numeric value (https://www.excelbanter.com/excel-programming/400592-char-numeric-value.html)

sharmashanu

char to numeric value
 
Hi All
I want to convert 10+930.000 to numric value. I have imported
these number and it is saved as charecter. I want the + sign also in
between once it is converted. Thanks all for any help

Regards

Shanu


Gary''s Student

char to numeric value
 
Try this:

Sub convertality()
For Each r In Selection
r.Formula = "=" & r.Text
Next
End Sub

--
Gary''s Student - gsnu2007a


"sharmashanu" wrote:

Hi All
I want to convert 10+930.000 to numric value. I have imported
these number and it is saved as charecter. I want the + sign also in
between once it is converted. Thanks all for any help

Regards

Shanu



sharmashanu

char to numeric value
 
It worked. Now is it possible to convert charecters with decimal eg:
"104+172.000" and ignore charecters without decimal eg: "104+180"


sharmashanu

char to numeric value
 
Hi Gary
This conversion is taking out "10+" and giving me only remaining
Thanks again


sharmashanu

char to numeric value
 
Hey dave..
It did as you said.but i want the 10+ also.. These are survey points.
Thanks


Dave D-C[_3_]

char to numeric value
 
I want the + sign also in between ..
I'm guessing you want the + sign in front.

Sub Demo()
MsgBox DCFormat("10+930.000") ' gives +940.000
End Sub

Function DCFormat$(pStr$)
Dim f1%, iPos%
iPos = InStr(pStr, "+")
f1 = Val(Left$(pStr, iPos - 1)) + _
Val(Mid$(pStr, iPos + 1))
DCFormat = IIf(f1 0, "+", "") & Format(f1, "000.000")
End Function ' D-C

sharmashanu wrote:
Hi All
I want to convert 10+930.000 to numric value. I have imported
these number and it is saved as charecter. I want the + sign also in
between once it is converted. Thanks all for any help
Regards
Shanu



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Dave D-C[_3_]

char to numeric value
 
Is it always a "+" sign?
Is the number before the "+" an integer? Range?
Is the number after the "+" always 3 decimal places? Range?
Do you want 3 decimal places in your output?
From "10+930.000" do you want "10+940.000"?
If not, what?
D-C

sharmashanu wrote:

Hi All
I want to convert 10+930.000 to numric value. I have imported
these number and it is saved as charecter. I want the + sign also in
between once it is converted. Thanks all for any help
Regards
Shanu

sharmashanu wrote:
Hey dave..
It did as you said.but i want the 10+ also.. These are survey points.
Thanks



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Ladymuck

char to numeric value
 
Unfortunately, nothing happened when I ran this.

"sharmashanu" wrote:

Hi All
I want to convert 10+930.000 to numric value. I have imported
these number and it is saved as charecter. I want the + sign also in
between once it is converted. Thanks all for any help

Regards

Shanu




All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com