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: 1
Default Searching using part of a word rather than whole word in vba


Ok i couldn't think how to word that in to a question very well (it
early and i need a smoke)..
Say i column 1 has several names, i wanna find the name of someon
called.. erm i dunno.. 'Dave'.. my search feature i have present mean
i have to type 'Dave' to find 'Dave', but what about 'David'? I jus
wanna beable to type 'Dav' and find all the 'daves' and 'davids'.
tryed recording a macro of myself doing the good ol' excel searc
(ctrl+f). Now that worked a charm.. except when it doesn't fin
anything and i get the error "Object variable or with block variabl
not set"
Could anyone help meh?

"My current search 'feature'" Wrote:
Private Sub CommandButton1_Click()
Dim search as String
search = txtsearch.Text
Columns("A:A").Select
Selection.fIND(What:=search, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext
_
MatchCase:=False, SearchFormat:=False).Activate
End Su


--
Devit
-----------------------------------------------------------------------
Devitt's Profile: http://www.excelforum.com/member.php...fo&userid=1442
View this thread: http://www.excelforum.com/showthread.php?threadid=26840

 
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
searching for a word(s) within a list Philippa Excel Discussion (Misc queries) 5 August 12th 08 07:30 PM
highlight the word when excel finds text you are searching for Sally M Excel Worksheet Functions 7 September 21st 06 06:07 PM
Is Excel or Word better for holding and searching data Ione Excel Discussion (Misc queries) 2 January 6th 06 09:46 AM
searching a cell for a contained text word Doug K Charts and Charting in Excel 0 June 20th 05 09:10 PM
Vlookup for part of a word jenhow Excel Worksheet Functions 7 April 29th 05 10:22 PM


All times are GMT +1. The time now is 11:59 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"