View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
aflatoon[_12_] aflatoon[_12_] is offline
external usenet poster
 
Posts: 1
Default Copy sheets to new workbook - subscript error


Assuming your value for i is correct (i.e. not greater than the number
of sheets), try saving the target workbook periodically (after every 10
copies for example).


the_tiger_grrr;697911 Wrote:

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



--
aflatoon

Regards,
A.
------------------------------------------------------------------------
aflatoon's Profile: http://www.thecodecage.com/forumz/member.php?u=1501
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=195202

http://www.thecodecage.com/forumz