Advanced filter current.region why does it give runtime error 1004

IanPM

Board Regular
Joined
Dec 12, 2013
Messages
53
Why does below auto filter fail when CurrentRegion was added. What will be the correct code to fix the 1004-The extract name has a missing or invalid name. I need to have a variable region for the auto filter?

The code

Sub DATA()

' DATA Import macro
Sheets("ACC&WD").Range("B8").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("L10:T11"), CopyToRange:=Range("B15:J15"), Unique:= _
False

End Sub

Thanks Ian
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,
is the worksheet protected? CurrentRegion property cannot be used on a protected sheet.

Dave
 
Upvote 0
The file was protected, but currently is not. The sheet is a new sheet & is not protected
 
Upvote 0
These ranges you are referring to are no the data ranges, but the criteria range L10:T11 & where to copy the auto filter to B15:J15. Th currentRegion refers to the data tat needs to copied into the auto filer. So the error relates to the data selection area ,which should start at Sheets ("ACC&WD") Cell B8.
 
Upvote 0
Are there any values in the destination range B15:J15?
 
Upvote 0
Found the solution to adapt the data source tables & some other changes. What I need to know is how can I manually enter values into the filtered information & not loosing it?
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,304
Members
448,564
Latest member
ED38

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