I am getting a "Subscript out of range" Error and cannot identify the correct solution. What am I missing? Please help.
Thank you
OX
Please Login or Register to view this content.
I am getting a "Subscript out of range" Error and cannot identify the correct solution. What am I missing? Please help.
Thank you
OX
Please Login or Register to view this content.
Last edited by oxv; 08-23-2012 at 02:34 PM. Reason: Added Code Tags
Hello oxv,
Welcome to the Forum!
A range object will always return a 2-D array of values even if the range is only a single row or column. You have to have 2 subscripts to access any element in the variant array "MyArr".
If you want to walk through the rows of "Parts Array" and it is a single column then you would use MyArr(i, 1), where 1 is the left most column of range. If it is a single row then you would use MyArr(1, i) where 1 is the top most most row of the range.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Yes, yes - so simple. I forgot about that.
Your right, rushing causes delays.
Thank you.
OX
Hello OX,
The devil is in the details. Glad I could help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks