Euro5
asked on
VBA run out of memory
The code Zone_Change worked on a small set of data, but with larger data I get a memory error.
Line - rngData = .Range("A2:BD" & .UsedRange.Rows.Count).Val ue
Is there another method other than the array?
I attached the entire project.
What-if-scenario-v4.2.xlsm
Line - rngData = .Range("A2:BD" & .UsedRange.Rows.Count).Val
Is there another method other than the array?
I attached the entire project.
What-if-scenario-v4.2.xlsm
Try closing Excel and reopening it. You could try rebooting your PC.
ASKER
Right, thanks for mentioning. I should have said that I did try that. It does most often work, but unfortunately didn't this time.
You could also include only the columns that you actually need to work with like
Range("A2:C,F2:J,M2:BD")
Do similar when you put the results back on the sheet.
Range("A2:C,F2:J,M2:BD")
Do similar when you put the results back on the sheet.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually with my code you'd need to do
Dim lngRows As Long
lngRows = ActiveSheet.UsedRange.Rows .Count
rng = Range("A2:C" & lngRows, "F2:J" & lngRows, "M2:BD" & lngRows)
Got to go. Play calls (actually a play)
Dim lngRows As Long
lngRows = ActiveSheet.UsedRange.Rows
rng = Range("A2:C" & lngRows, "F2:J" & lngRows, "M2:BD" & lngRows)
Got to go. Play calls (actually a play)
ASKER
I think that you offered this before - it worked again.
I think there are some other places that this will be helpful.
I think there are some other places that this will be helpful.
ASKER
@Martin - what play!??
West Side Story
ASKER
Nice. Hope you enjoy! Love musicals and opera.