Filtro avanzado en macro con error 1004

Caliche

Active Member
Joined
Mar 26, 2002
Messages
339
Juan Pablo:

Anexo encontrarà algo que coloqué en el Message Board en el dìa de hoy. Ya hay dos respuestas, pero desafortunadamente la primera no soluciona mi problema y la segunda, realmente no entendí mucho lo que significa.

Podría darme alguna ayuda adicional ?.

Muchas gracias.

Esto fuè lo que puse en el Board:

************

In the following macro I am getting 1004 error (Failure in Advanced Filter Method of Range Class). I have been told that for Advanced Filter your ranges must be in the same workbook, but you can avoid this situation using named ranges, as in my case, where criteria and "copy to" ranges are in a workbook (Disp_Dem.xls), and data range is in another workbook (Trabajo.xls).

Here is my code.

Sub Cons_Ord()
'
' Order Filter
'
Workbooks("Disp_Dem").Activate
Worksheets("OF").Select
Range("Crit_Lanz").Select
Range("Trabajo.xls!Datos_lanz").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("Disp_Dem.xls!Crit_Lanz"), CopyToRange:=Range("Disp_Dem.xls!Rango_Lanz"), Unique:=False

End Sub

Any suggestions in order to avoid this error?.

Thanks in advance.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
El error 1004 es bastante común, mejor dicho, no es "restringido" a la operación de Filtro Avanzado.

Cuál es la operación concreta que está tratando de hacer ?
 
Upvote 0
Estaba tratando de hacer un filtro avanzado con rangos nombrados de libros diferentes. Ya corregí el error que se me presentaba. De todas maneras, muchas gracias por su ayuda.
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,513
Members
448,967
Latest member
screechyboy79

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