Hi all,
I've been running a VBA macro dealing with 2 xls sheets, one with approx 15,000 rows, and one with now over 30,000 rows. Somewhere between 30,000 and 30,700 I am now up to, the part of my macro which concatenates the 30,000 row spreadsheet and then pastes into the 15,000 row spreadsheet breaks.
The error I get is "Run-time error '1004': Application-defined or abject-defined error
This is while running "Ar(1).Offset(-1) = Trim(Join(Application.Transpose(Ar), ", "))" in the following piece of VBA:
After some googling I've found VBA may have a limit at 32,000 rows of data to copy/paste. I'm not convinced this is my issue though as I'm just shy of this number. If this is the issue, I don't understand how exactly I'm likely to be able to work around it - as in the future these rows are only going to increase to somewhere around 60,000.
As always any help or advice would be very much appreciated!
I've been running a VBA macro dealing with 2 xls sheets, one with approx 15,000 rows, and one with now over 30,000 rows. Somewhere between 30,000 and 30,700 I am now up to, the part of my macro which concatenates the 30,000 row spreadsheet and then pastes into the 15,000 row spreadsheet breaks.
The error I get is "Run-time error '1004': Application-defined or abject-defined error
This is while running "Ar(1).Offset(-1) = Trim(Join(Application.Transpose(Ar), ", "))" in the following piece of VBA:
Code:
Sub ConcatBetweenBlanks()
Dim Ar As Range
For Each Ar In Columns("B").SpecialCells(xlConstants).Areas
If Ar.Count = 1 Then
Ar(1).Offset(-1) = Ar
Else
Ar(1).Offset(-1) = Trim(Join(Application.Transpose(Ar), ", "))
End If
Next
Columns("A").SpecialCells(xlBlanks).EntireRow.Delete
End Sub
After some googling I've found VBA may have a limit at 32,000 rows of data to copy/paste. I'm not convinced this is my issue though as I'm just shy of this number. If this is the issue, I don't understand how exactly I'm likely to be able to work around it - as in the future these rows are only going to increase to somewhere around 60,000.
As always any help or advice would be very much appreciated!