Hi!
Please help me solve the following problem...
I'm trying to copy a range from the worksheet into a VBA array. This range is basically a column of zeroes and ones. Then I want to perform operations on this array: to increment the counter if an array element is 1 and to decrement if it is 0. Then I need to pass all the intermediary positions of the counter into another array. Which I would copy into another range on the worksheet.
If I only increment the counter, everything goes fine. But when I try to decrease it, I get a "subscript out of range" error. I guess it happens because I have a negative number in the ReDim Preserve statement.
I'm a VBA newbie and can't figure out the solution for this.
The following code gives me a "Subscript of Range" error.
Bookmarks