Error "Microsoft office excel cannot create or use the data range reference because it is too complex"

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi 'm getting this error message "Microsoft office excel cannot create or use the data range reference because it is too complex" when i try to delete/copy/cut/select chunk of data...

Can someone please help me with this get rid of this error messange and work this out?

I have data of more then 557000 row....4 cols...

Please advice.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Are you trying to edit a large amount of data at once? If so, try breaking it off into chunks. Editing ~2 million cells at once is a lot.
 
Upvote 0
Hi thanks for answering....

breaking data takes around 3mins...filtering errors...and for loop takes almost 6mins....
So pls help!
 
Upvote 0
One of the code:
Code:
[/FONT]
[FONT=Courier New]Option Explicit
Sub loop4()
Dim lr As Long
Dim i As Range
lr = Range("A" & Rows.Count).End(xlUp).Row
 For Each i In Range("A1:A" & lr)
  If i.Value Like "MyIndex No:" & "*" Or i.Value Like "Data Xi No:" & "*" Then
   i.Copy Range("F" & Rows.Count).End(xlUp).Offset(1, 0)
  End If
 Next i
End Sub
 
Upvote 0
Try:

Code:
Sub loop4()
Dim lr As Long
Dim i As Range
Dim tmp As String
lr = Range("A" & Rows.Count).End(xlUp).Row
 For Each i In Range("A1:A" & lr)
  tmp = Left$(i.Value, InStr(i.Value, ":"))
  If tmp = "MyIndex No:" Or tmp = "Data Xi No:" Then
   i.Copy Destination:=Range("F" & Rows.Count).End(xlUp).Offset(1, 0)
  End If
 Next i
End Sub
 
Upvote 0
How can i break down data?

Can you pls write a code to divide data into 4 different part from count of A and then cut and paste it in different sheet organise and bring required data back to same old sheet?

Thanks again
 
Upvote 0
Thanks alot but it still does takes around 5.23 mins...:)

That's because you didn't turn off calculations and screenupdating. This should considerably speed it up.

Code:
Sub loop4()
Dim lr As Long
Dim i As Range
Dim tmp As String
With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
    .EnableEvents = False
End With
lr = Range("A" & Rows.Count).End(xlUp).Row
For Each i In Range("A1:A" & lr)
    tmp = Left$(i.Value, InStr(i.Value, ":"))
    If tmp = "MyIndex No:" Or tmp = "Data Xi No:" Then
        i.Copy Destination:=Range("F" & Rows.Count).End(xlUp).Offset(1, 0)
    End If
Next i
With Application
    .ScreenUpdating = True
    .Calculation = xlCalculationAutomatic
    .EnableEvents = True
End With
End Sub
 
Upvote 0
Thanks...thats much better MrKows! I did turn off screen updating but didnt take care of calculation part...

Can you also please help me with my post#8?
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

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