I have a string passed to a VBA sub, which is of the format “Sheet1:Sheet5!A1:D10”, referring to a range across several worksheets in the same workbook (Sheet2, Sheet3 and Sheet4 are between Sheet1 and Sheet5).
The problem I have is that I cannot apply this reference to a range variable, which as far as I can tell is due to the multiple references, and I cannot use application.union since the ranges are on different sheets.
How can I extract from this string the five individual ranges of Sheet1!A1:D10, Sheet2!A1:D10 and so on?
This will get you the string representations of each one and then store in an array. It makes a few assumptions (that the sheets exist, that the first one listed is first in the index order, that you want everything between the two with regards to index. etc.), but it may work for your situation: