this may not be the best way to do this but it would work. Assuming that the number you have can be stored as a string
Dim inputnumber As string 'The number you want to remove the comman from
Dim number() As String
Dim left As String
Dim right As String
Dim total as String
Dim totalint As integer
number = Split(inputnumber, ",")
left = number(0)
right = number(1)
total = left & right
if you want to turn that number back to an integer
totalint = val(total)
I didnt get it working,.. Maybe I did something wrong..
the number I want to change, is not always the same. I have a label in my form called "three" this is where the number is captured. Please expain the code, and how to use it.
what exactly do you mean by you have a label where the number is captured. Can you show some of the code to do that or give a little more information? Assuming that the number you are pulling from the website is a string then the code i provided should work. If it is an integer then you would have to create a new variable as a string and then set it equal to the integer you are pulling from the website. The Split function works with strings. Essentially, I stored the integer string into the array "number". Split separates the string by the delimiter you set, in this case it is the comma. Then left would be the first element in the array (which is the information to the left of the comma. Right would be the second element in the array (the number to the right of the comma). Then i took both those strings and stored them as one string (so the whole string would be 1200). You can then convert that to an integer you the val function if you need to do math or something with it.
I am all new to this, So Dont really know what a string is yet. So I will expain in detail..
The number I capture is a part of a text in a website, So I had to use this to capture the number I wanted. I now have a label in my app. called "armysize", where the number I captured is shown.
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert
If I capture a number from a site, and it says 1,200
how can I take the "," away to make it 1200?
This is in Visula Basic. I have a label with the captured number.
Hi! im just trying to answer based on your given example. trying to get the (,) comma from 1,200 to make it 1200 right? let's assume that the value of variable num is 1,200 then after getting rid of the comma, it'll be shown on a msgbox.