View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default What's wrong with this picture

"Jennifer" wrote in message
...
Ok this doesn't work unless the producedata is active. WHY? Just when I
thought I was getting this!
Sub UpdateInvoiceList()
With Worksheets("ProduceData")
.Range("Invoice").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"q2"), Unique:=True
.Range("InvoiceList").Sort Key1:=Sheets("ProduceData").Range("q3")
End With

End Sub


Hi Jennifer,

You have an unqualified Range method call in the CopyToRange argument of
the AdvancedFilter method. If Range("q2") refers to a cell located on the
ProduceData worksheet, simply placing a dot in front of Range("q2") will
solve the problem.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm