Code to copy multiple books - 10,000 rows limit - help

NeelsBorstlap

New Member
Joined
Jul 23, 2010
Messages
25
Hi - I am using the this code to copy multiple books data in to a single book and not to "re-copy" data with the same date that is already in the single book.

It woks 100% and fast BUT it stop working when the data in the single book get more than 10,000 rows.

Is there someone that can help me with code that will do the same but not with the 10,000 row limit.



Code:
Option Explicit


Sub ExtarctFromMultipleBooks()


Dim LineCounter As Integer
Dim CurrentBook As String
Dim LastDate As Date
Dim LastRow As Long
Dim LastRowMaster As Long
Dim Branch As String


For LineCounter = 3 To 18
    With ThisWorkbook
        LastRowMaster = .Worksheets("Master").Range("A65536").End(xlUp).Row
        With .Worksheets("Sheet2")
            CurrentBook = Trim(.Range("b" & LineCounter).Value)
            Branch = .Range("c" & LineCounter).Value
            LastDate = .Range("d" & LineCounter).Value
        End With
    End With
    On Error GoTo NoSuchBook
    With Workbooks(CurrentBook & ".xls").Worksheets("sheet1")
        LastRow = .Range("A65536").End(xlUp).Row
        .Columns("A:D").AutoFilter Field:=2, Criteria1:=">" & Format(LastDate, "mm/dd/yy"), Operator:=xlAnd
        If .Range("A65536").End(xlUp).Row = 1 Then
            MsgBox ("No New Data Found in " & CurrentBook)
        Else
            .Range("A2:IN" & LastRow).SpecialCells(xlCellTypeVisible).Copy ThisWorkbook.Worksheets("master").Range("A" & LastRowMaster + 1)
            .ShowAllData
        End If
    End With
Next LineCounter
Exit Sub




NoSuchBook:
MsgBox (CurrentBook & " is not open or spelt incorrectly - macro cancelled")
End Sub
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,215,491
Messages
6,125,111
Members
449,205
Latest member
ralemanygarcia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top