Hi,
I have an array in VBA that is filled with string values representing numbers.
So, one of them might look like a number, but the type in a locals window would look like
Value
"128371"
Type
Variant/String
I would like to convert this to an integer before writing out the array to a worksheet, but can't quite get it to work in array.
I have tried CInt(x), but get a type mismatch error on the conversion line, presumably because it's missing quotes.
For example, if x(1)=128371 as type String,
using CInt(x) or CInt(""" & x & """) returns the type mismatch error.
Not sure how to keep it in the vba/array and make it work.
I have an array in VBA that is filled with string values representing numbers.
So, one of them might look like a number, but the type in a locals window would look like
Value
"128371"
Type
Variant/String
I would like to convert this to an integer before writing out the array to a worksheet, but can't quite get it to work in array.
I have tried CInt(x), but get a type mismatch error on the conversion line, presumably because it's missing quotes.
For example, if x(1)=128371 as type String,
using CInt(x) or CInt(""" & x & """) returns the type mismatch error.
Not sure how to keep it in the vba/array and make it work.