Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Multiple Find/Search Criterias

Hi all,

I was wondering if there is anyway i simplify the following code to do
multiple search criterias.

On Error Resume Next

Cells.Find(What:="valdate", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

Cells.Find(What:="invaldate", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

On Error Goto 0

Thanks in advance
Ray
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Multiple Find/Search Criterias

'*valdate' (w/o the quotes) will work in this specific instance.
However, AFAIK, there is no generic 'or' or 'and' capability within the
Find method.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Hi all,

I was wondering if there is anyway i simplify the following code to do
multiple search criterias.

On Error Resume Next

Cells.Find(What:="valdate", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

Cells.Find(What:="invaldate", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

On Error Goto 0

Thanks in advance
Ray

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Multiple Find/Search Criterias

Hi Tushar

Thank you for your tip, i guess i will

have to find a better way,

coz i am searching for multiple different

words and cannot just use a wildcard.

Have a good day.

Rgds
Ray
Reply
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 MAX of column from using 2 criterias Sunnyskies Excel Discussion (Misc queries) 3 April 16th 10 05:12 PM
Search criterias? shnim1 Excel Discussion (Misc queries) 1 December 2nd 06 07:55 AM
DCOUNT WITH MULTIPLE CRITERIAS cltjohn Excel Worksheet Functions 2 May 17th 06 10:30 AM
How can I have excel search and add multiple cells to find a targe Blakepro Excel Discussion (Misc queries) 1 April 1st 05 02:37 AM
multiple search criteria to find and copy from sheet1 and paste into sheet2 lothario[_54_] Excel Programming 2 November 25th 03 09:57 AM


All times are GMT +1. The time now is 01:30 AM.

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

About Us

"It's about Microsoft Excel"