Hi everyone,
I'm writing some code that inserts two new sheets into workbook.
then I'm gonna copy the information from all the other sheets into the two new ones (they're called "DT and "HD").
However, I want to move the two new sheets to the end of the list, and tell the loop to finish when the sheet named "DT" is selected.
the best I've come up with so far is this:
The trouble is that not all the workbooks I'l be using this on end on sheet 11.
how can I tell excel to put the sheets at the end of the list of sheet tabs?
I'm using:
to loop though the sheets.
thanks,
Paul
I'm writing some code that inserts two new sheets into workbook.
then I'm gonna copy the information from all the other sheets into the two new ones (they're called "DT and "HD").
However, I want to move the two new sheets to the end of the list, and tell the loop to finish when the sheet named "DT" is selected.
the best I've come up with so far is this:
Code:
Sheets("HD").Move After:=Sheets(11)
The trouble is that not all the workbooks I'l be using this on end on sheet 11.
how can I tell excel to put the sheets at the end of the list of sheet tabs?
I'm using:
Code:
ActiveSheet.Next.Select
to loop though the sheets.
thanks,
Paul