Working in Microsoft Excel, I have been trying to create an array using an unspecified number of cell values in a list, and then use that list to select worksheet pages of the same name in the workbook, but have been getting Subscript out of range errors. While building the array the code ensures all the specified pages exist. Here's more or less what i'm trying to do:
While cell.value <> ""
X=X+1
GoodArray(X) = Value
(goto next cell)
Wend
Sheets(GoodArray).Select
This isn't working, but both of these do:
1. Sheets("Sheet1","Sheet2"
.Select
2. B = array("Sheet1","Sheet2"
Sheets(B).Select
I tried ReDim'ing the GoodArray to one higher each time i wrote to it, so it would be exactly the right length, but that didn't fix anything. Wasn't sure if that was my problem or not.
Any suggestions? Thanks!
While cell.value <> ""
X=X+1
GoodArray(X) = Value
(goto next cell)
Wend
Sheets(GoodArray).Select
This isn't working, but both of these do:
1. Sheets("Sheet1","Sheet2"
2. B = array("Sheet1","Sheet2"
Sheets(B).Select
I tried ReDim'ing the GoodArray to one higher each time i wrote to it, so it would be exactly the right length, but that didn't fix anything. Wasn't sure if that was my problem or not.
Any suggestions? Thanks!