Hi all,
I have some old code that was written for Excel 2000, but I've since found a similar subroutine on MSDN which exhibits the same behaviour.
This code encapsulates the problem (the whole VBA is much longer).Please Login or Register to view this content.
Column text headings are in A1 to n1 (i.e. dynamic range). Here a worksheet is added for each column header with the value of the header becoming the worksheet name.
The issue is that the Sub routine exits (without error) when the first worksheets.add statement is reached, so the loop is only entered once.
I've never seen this before.
If I omit the worksheets.add statement, the loop happily iterates through the headers, selecting each of them.
any ideas?
cheers,
Kieran
Bookmarks