Posts by Mark_11

    Re: Looping through sheets and workbooks using array

    No Stephen, I have changed the sheet names but the logic is the same and they've worked before with an array.
    It appears to be the Workbook part that is causing the problem. Actually I've been trying a number of solutions and mistakenly put the wrong part in error - apologies for that (the irritation is affecting my focus). It is the line:

    Set WB_temps(Cnt) = Workbooks.Open("schools_data_" & (Cnt)& ".xlsx")

    that is causing an error, which is noted as <Subscript out of range> after first opening successfully the first workbook.

    Apologies again,

    Re: Looping through sheets and workbooks using array

    Yes Stephen they are just typos caused by hacking out loads of irrelevant code.
    It is the Set School_index = WB_temps etc that doesn't work. The Sheets part is ok, but it doesn't like the WB_temps(Cnt) part.

    This is grinding me down and appears to be a simple issue. I'm trying to loop through 4 workbooks that are opened alongside other books, then from the same named sheets from each of the 4, copy rows. It's not working. Any thoughts would be appreciated.