rcbatlinux
Technical User
I am trying to automate a filter lookup and then copy the results using a macro. The problem I'm having is specifying the criteria. I want the criteria lookup be based on the value of a field. Here is what I have:
Range("B1".Select
Selection.Copy
Sheets("Team Data".Select
Range("L2".Select
ActiveSheet.Paste
Range("A1".Select
Application.CutCopyMode = False
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:=
If I make the Criteria1:= a literal it works fine. But I want it to look at the value of a cell. I tried entering in the cell address and the range command but neither worked. Any ideas?
Rick
Range("B1".Select
Selection.Copy
Sheets("Team Data".Select
Range("L2".Select
ActiveSheet.Paste
Range("A1".Select
Application.CutCopyMode = False
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:=
If I make the Criteria1:= a literal it works fine. But I want it to look at the value of a cell. I tried entering in the cell address and the range command but neither worked. Any ideas?
Rick