I have a cell containing something like "12_34_56"
I used:
MyNumbers = Split(Cells(1, 1).Value, "_")
to split the numeric values into an array , but the result is an array of strings!
I know that I can use CInt on every value of the array but isn't any way to obtain a numeric array directly?
thanks in advance
As far as I'm aware it's not possible to convert one type of array into another type with a single call, but if you're going to be doing this conversion in multiple locations the obvious option is to write a function that returns the desired result, as below:
When you need this functionality you can just call this function as a one-liner as you would the Split function.
This worked great for me and was very easy to set up! I will use cell A1 as the example with the string of numbers.