Variable data to copy in to filters "comments"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The problem is that the data in ("F1") is variable.
When i record a macro, the data that is in ("F1") the first time stays in "criteria1".
I need it to change when the data changes in ("F1")
How to do this?

Range("F1").Select
Selection.Copy
Sheets("Recepten").Select
Selection.AutoFilter Field:=5
Selection.AutoFilter Field:=4, Criteria1:="=IMP12-C", Operator:

Thanks all
 
...., Criteria1:="=IMP12-C", ...

could be:

...., Criteria1:=range("F1").value, ...
 
Sorry but that did't do it.
The data in F1 also comes from an other Sheet but i don't think that should mather.
 
Do you mean that the F1 cell you're looking at is on another worksheet?

If yes:
....., Criteria1:=worksheets("otherworksheet").range("F1").value, ...

If no:
You sure that the value in F1 actually occurs in your lookup range?

That change works for me when there's data to match.
 
They usually work the second time!

But I should have noticed in your code that you were changing sheets (or at
least it looked that way).
 
Back
Top