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.
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.