ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   decimals and oracle (https://www.excelbanter.com/excel-programming/406943-re-decimals-oracle.html)

Nicolas Cage

decimals and oracle
 

"Joel" ha scritto nel messaggio
...
Sub test()

MyNumber = "100.000,00"
location_period = InStr(MyNumber, ".")
location_comma = InStr(MyNumber, ",")
If location_comma location_period Then
MyNumber = Replace(MyNumber, ".", ";")
MyNumber = Replace(MyNumber, ",", ".")
MyNumber = Replace(MyNumber, ";", ",")

End If

Not correct, if number is "100,000,00" ?



joel

decimals and oracle
 
The new code will work under ANY case. I originally solved the problem as
you posted it.

"Nicolas Cage" wrote:


"Joel" ha scritto nel messaggio
...
Sub test()

MyNumber = "100.000,00"
location_period = InStr(MyNumber, ".")
location_comma = InStr(MyNumber, ",")
If location_comma location_period Then
MyNumber = Replace(MyNumber, ".", ";")
MyNumber = Replace(MyNumber, ",", ".")
MyNumber = Replace(MyNumber, ";", ",")

End If

Not correct, if number is "100,000,00" ?





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

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