LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Find part of a word in Advanced Filter Code

I sent this originally to the worksheet funtions newsgroup but then
realised that it is probably more of a programming issue than a funtions
issue. So sorry for the double post...

I'm trying to get an advanced filter to work so that it will bring back
all records
with part of the word rather than just the start of a word. This works
very well when I use AutoFilter with the "Contains" criteria. But when I
do an advanced filter, only records that start with the word get filtered.

I have something like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Target.Address = "$A$2" Or _
Target.Address = "$B$2" Then
Range("Database").AdvancedFilter _
Action:=xlFilterInPlace, _
Unique:=False
End If
End Sub

This is code when you right click the tab. I tried putting "*" in various
places in
this code but can't get it to work. The only way is to put a "*" before
any word I'd
like to search for in the B2 or A2 cell. This works, but I'd like to be
able have it do it automatically so that I just have to type the word I'm
looking for without any "*"'s.

Thanks..
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find blank with Advanced Filter CJ Excel Discussion (Misc queries) 2 December 16th 08 10:46 PM
Code to replace Advanced Filter RobN[_2_] Excel Discussion (Misc queries) 4 June 14th 07 12:31 PM
Advanced Filter contains part of a word Sierras Excel Worksheet Functions 3 March 8th 06 08:20 PM
Find part of a word in cell Elaine Excel Discussion (Misc queries) 7 March 3rd 06 07:37 PM
Problems implementing advanced filter code... jarviscars Excel Programming 7 January 5th 06 03:06 PM


All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"