Convert string array to variant array, or "Array("111", "222")" to Array("111", "222")

Rowland Hamilton

Active Member
Joined
Nov 13, 2009
Messages
250
Folks:
I used a method to create an array that is actually a string, and captured account numbers (text values) like this:
Code:
strArray = "Array("111", "222", "333")"
[End CODE]

But I want to convert it to a variant like:
[CODE]
vntArray = Array("111", "222", "333")
[End CODE]

so that I can use LBound and UBound code on the array.

How do I do this?

Originally, I tried to use the string, but after getting runtime error type 13 mismatch, I manually copied the debug.print of the array, and redefined it without the leading and trailing quotes, and stopped getting the error.

Also, how do you widen the code windows when you post?

Thanks, Rowland
 
Last edited:
Thanks, I realized was probably a bad question, because I hadn't yet changed the code to consider the new dynamic method. Once I started to, I realized I would have to just change the code to add 1 to the named range search. ie Budget(x+1) = vntArray(x)
 
Last edited:
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top