I have a macro which changes a worksheet based on each record from another sheet, it then copies the worksheet. I.e. a new sheet is created for each record simpy with...
Sheets("Proforma").Select
Sheets("Proforma").Copy after:=Sheets("Proforma").
tmpsht = Sheets("Proforma").Name & " (2)"
Sheets(tmpsht).Name = ShtNm '(ShtNm changes for every data set)
This works fine but only copies about 30 sheets before the macro stops and says 'copy method of worksheet class failed'. At this point, even if I delete the 30 sheets and manually try and copy the sheet I am unable to.
Is there a maximum number of sheets that I can have?
Every time I copy a named range is being created, is it something to do with a limited number of names?
Other?
Grateful for any advice
Bookmarks