Get value from textbox and use it in the form of Array.
So basically what I am doing is,converting fixedwidth file.
I recorded a Macro for that. And delimiting the values. And the below value I am getting from userform. (Bold and underlined)
. TextFileFixedColumnWidths = Array(3, 5, 8, 8, 13...)
so user will enter values in text box like- 3 ,5, 8, 8, 13...)
Now I declared a variable.
Dim delimitvalues As Variant
delimitvalues = UserForm1. Textbook. Value
And then code
.
.
.
. TextFileFixedColumnWidths = Array(delimitvalues)
but this is not working it's shows error-Run time error 5 (Invalid procedure call or argument)
what I understand is it's taking as string and not as array.
Even I tries to remove double quotes by
delimitvalues=Replace(delimitvalues, Chr(34), "")
I tried this also
MyZeroBasedArray = Split (delimitvalues, ", ")
but nothing worked.
please help me on this with whichever method possible.
I hope my question is clear pleas let me know i will clarify.
So basically what I am doing is,converting fixedwidth file.
I recorded a Macro for that. And delimiting the values. And the below value I am getting from userform. (Bold and underlined)
. TextFileFixedColumnWidths = Array(3, 5, 8, 8, 13...)
so user will enter values in text box like- 3 ,5, 8, 8, 13...)
Now I declared a variable.
Dim delimitvalues As Variant
delimitvalues = UserForm1. Textbook. Value
And then code
.
.
.
. TextFileFixedColumnWidths = Array(delimitvalues)
but this is not working it's shows error-Run time error 5 (Invalid procedure call or argument)
what I understand is it's taking as string and not as array.
Even I tries to remove double quotes by
delimitvalues=Replace(delimitvalues, Chr(34), "")
I tried this also
MyZeroBasedArray = Split (delimitvalues, ", ")
but nothing worked.
please help me on this with whichever method possible.
I hope my question is clear pleas let me know i will clarify.