Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default comlex Find statement

Is it possible to write a single Find statement in code that will search for
a first string in say Range("A2") and if true look for another string in
Range("B2").
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default comlex Find statement

Use LEFT,MID,RIGHT functions

A2 = apple
B2 = boy

=IF(LEFT(A2,1)="a",LEFT(B2,1),"")
--
If this post helps click Yes
---------------
Jacob Skaria


"Farooq Sheri" wrote:

Is it possible to write a single Find statement in code that will search for
a first string in say Range("A2") and if true look for another string in
Range("B2").

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default comlex Find statement

Why do you think it is important for it to be a single statement? Aside from
that, it would have been nice if you gave some examples so we would know if
you are trying to find whole or partial matches. With that said, I don't
think you need to use the Find function at all. If you are looking for whole
matches, then just test the cells content directly...

If Range("A2").Value = "Text1" And Range("B2").Value = "Text2" Then

If, on the other hand, you are looking for partial matches, then use the
InStr function...

If InStr(Range("A2").Value, "Text1") 0 And _
InStr(Range("B2").Value, "Text2") 0 Then


--
Rick (MVP - Excel)


"Farooq Sheri" wrote in message
...
Is it possible to write a single Find statement in code that will search
for
a first string in say Range("A2") and if true look for another string in
Range("B2").


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
Is it possible to find which sql statement is running? nkw Charts and Charting in Excel 0 September 8th 06 05:56 AM
If statement to find NA() Barb Reinhardt Excel Worksheet Functions 1 March 31st 06 05:50 PM
If statement to find NA() Barb Reinhardt Excel Worksheet Functions 0 March 31st 06 05:49 PM
Copying text value based on long (comlex) calculation gezuvor Excel Discussion (Misc queries) 2 January 12th 06 01:36 AM
Copying text value based on long (comlex) calculation gezuvor Excel Discussion (Misc queries) 0 January 12th 06 12:15 AM


All times are GMT +1. The time now is 05:12 PM.

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"