I have a two dimentional array that's redim preserved:
If I don't have "erase ar()" line then if I run a few times (consecutively) then I get the same array stacked multiple times. If I have that line then I don't get any results (if I run multiple times - the first time is OK)sub test() dim ar() x=0 Do x=x+1 redim preserve ar (1 to 5, 1 to x) ar(1,x)=** ar(2,x)=*** ... loop while **** sheet1.range("a1:f" & x)=application.worksheetfunction.transpose(ar) erase ar() end sub
If I don't run it consecutively then there's no issue. Just wondering why and if it's OK to run multiple times(in case client does it even there's no reason to run multiple times). Any insight is appreciated!
Bookmarks