ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Next Function in Array (https://www.excelbanter.com/excel-programming/437018-next-function-array.html)

DMJohnDeere

Next Function in Array
 
I have a macro that I am running in Excel which is (1) retrieving data from a
database, (2) making a copy of the worksheet (3), copy and pasting the
values, (4) and then repeating the same process over and over again.

At the beginning of the macro I am declaring an Array of 43 items and then I
am using a "Next" statement to cycle through the each item. It is working
just fine until it gets to the last item in the array. At that point it will
not make a copy of the worksheet and even if you cancel the macro and try to
do it manually it will not copy the worksheet. You can create a new blank
worksheet, but you can' copy one. Any idea what would be causing this. The
number or worksheets in the workbook at the time of the error is 48, which I
don't believe is the problem because I'm sure I've had files with more
worksheets than 48. Your help would be greatly appreciated.




All times are GMT +1. The time now is 11:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com