Hey guys, I have a string that I want to convert to integer, but some strings have a letter on it like (13k). How would I make it so if the “convert string to integer is not valid” error appears, I want to move on to the next item?
Hey guys, I have a string that I want to convert to integer, but some strings have a letter on it like (13k). How would I make it so if the “convert string to integer is not valid” error appears, I want to move on to the next item?
Cint(“13K”.replace(“K”,“000”))
Please mark as solution if found useful
I understand you are using a loop. Some rows in this loop are denoted by k instead of 1000. That’s why convert gives an error.
You can use an earlier condition if you want to move to the next one in the catch.
Regards,
MY
Regex can help (import System.Text.RegularExpressions to the namespaces, imports panel)
when we only have XXXk or XXXK values
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.