PDA

View Full Version : Solved: AutoFilter



Syph
06-20-2009, 12:01 PM
hi im trying to write a simple macro to apply an Auto filter.

I want the filter to take a user entered value from cell 'B2' and apply the auto filter to column B to show any entries that contain the user entered value.

Up to now this is what i have and i have no idea why it wont work!


Sub Marco10()
'
'
Range("B2").Select
Selection.Copy
Selection.AutoFilter Field:=2, Criteria1:="Selection.Paste", Operator:= _
xlAnd
End Sub

The .xls file is attatched if this helps.

Any help would be much appreciated!

Cheers

lucas
06-20-2009, 12:24 PM
search by the partial string TUB? or will you use a drop down to select from unique entries in Col B?

lucas
06-20-2009, 01:09 PM
Not sure but if you want to search for a partial string, this will copy it to sheet 2.

see attached.

Syph
06-20-2009, 02:27 PM
Thats spot on. Thank you!