It always crashes on tab #66. Part of the issue is im using a variable telling the macro what row to past each tab (based on a reference table on a separate tab); as not to overwrite the previous copy/paste. The interval are in rows of 500. So tab 1 copies into row 1 - 499, tab 2 copies into row 500- 1000, etc.
The final tab copies into row 40,500. So there shouldn't be a max row issue?
I can't figure it out.. please help:
Expand|Select|Wrap|Line Numbers
- Dim i As Integer
- iBegTab = 2
- iEndTab = 82
- For i = iBegTab To iEndTab
- Dim iCurrent As Integer
- Dim iPasteRow As Integer
- iCurrent = ActiveSheet.Index + 1
- iPasteRow = Sheet96.Cells(i, 9) - This is the code that errors once it hits tab 66
- Sheets(iCurrent).Select
- Rows("7:7").Select
- Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
- Selection.AutoFilter
- Selection.AutoFilter Field:=3, Criteria1:="<>"
- Selection.AutoFilter Field:=8, Criteria1:="<>0", Operator:=xlAnd
- Rows("8:8").Select
- Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
- Selection.Copy
- Sheets("Consolidation").Select
- Cells(iPasteRow, 1).Select
- ActiveSheet.Paste
- Sheets(iCurrent).Select
- Selection.AutoFilter
- Next i