View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Excel macro filter Like keyword

Is A1 on the same worksheet as the sourcerange?

with SourceRange
.AutoFilter Field:=1, Criteria1:="*" & .parent.range("A1").value & "*"
End with

The parent of sourcerange is the worksheet that owns it.



"Jeff via OfficeKB.com" wrote:

I am trying to program a filter so that it searches a keyword among a string
of characters in my first column
I used a combo to feed a linked cell. I have the following code:

Private Sub ComboBox1_Change()

SourceRange.AutoFilter Field:=1, Criteria1:="Like & " * "& A1 & " * ""

End Sub

I have a type mismatch error.

Any help would be great!

My criterion (linked) cell is A1

Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/201003/1


--

Dave Peterson