Out of Memory when loading huge range into an array

jscranton

Well-known Member
Joined
May 30, 2011
Messages
707
I am comparing the used range on every worksheet on two workbooks to find cells that were changed. Some of these worksheets have a massive range:

A$1:$CD$1048575

When I try to load this into an array, I get and Out of Memory error.

Is there anyway around this?
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
2,945
Dim X as Long

Set X = Range("A1:CD1048575")

????
 

offthelip

Well-known Member
Joined
Dec 23, 2017
Messages
1,071
Office Version
2010
Platform
Windows
Have you tried loading the values into a variant array, this will be much smaller than a range array
Note NO "Set"

Code:
Dim inarr as variant
inarr=Range("a1:cd1048575")
 

Forum statistics

Threads
1,089,437
Messages
5,408,214
Members
403,190
Latest member
RBrite

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top