View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Copy sheets to new workbook - subscript error

See
http://support.microsoft.com/kb/210684/en-us


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm



"the_tiger_grrr" wrote in message
...
G'day all you clever people, hope someone can help me

I am using the code:

ActiveSheet.Copy after:=Workbook("Example.xls").Sheets(i)

to copy a dynamic selection of sheets from one workbook to another

The code works just fine until the 18th sheet is copied across, then I get a
subscript out of range error message

This is really frustrating as I know the code works, but I am limited in how
often I can use it, and I want to copy across 50+ sheets.

Has anyone come across this issue before and does anyone know a good way to
solve it?

PS, I ran the same code in Excel2007 and managed 45 repititions before I get
the same subscript out of range error

Kind regards
Tiger