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: 363
Default Add 2nd condition to Find

The below code searches for the Value that was selected in Listbox2.
But i have found that there maybe more than 1 value in that column (C)
If there is i Always gain the same data.
I placed the (<=== HERE) line of code to try to include a 2nd condition to ensure the correct data
is selected, but even though there IS a match, i get NO DATA at all.

The value in rngFound.Offset(0,15) is Always a date (dd/mm/yyyy) and the value in rngfound is Always
Text.

Dim rngFound As Range
On Error Resume Next
Sheets("Data2").Visible = True
Sheets("Data2").Unprotect
With Worksheets("Data2").Range("C:C")
Set rngFound = .Find(What:=ListBox2.Value, After:=.Cells(1), LookIn:=xlValues, LookAt:=xlWhole,
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False)
If rngFound.Value < "" And ListBox3.Value = rngFound.Offset(0, 15).Value Then <=== HERE
....
....
....
end if
end with

Why does this not find the data with the 2nd condition ?


Corey....


 
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
SUMPRODUCT with condition FIND(text) is false Go Bucks!!![_2_] Excel Worksheet Functions 2 October 7th 09 04:56 PM
If condition to find Target Karthik Excel Discussion (Misc queries) 1 May 23rd 09 10:49 AM
How to find first row where condition is true? WhatsUp31415 Excel Discussion (Misc queries) 6 May 21st 09 12:11 PM
?How can I find the maximum column with condition SAM SEBAIHI Excel Discussion (Misc queries) 4 February 9th 07 05:53 AM
Find and replace with condition Stuart Excel Discussion (Misc queries) 5 July 26th 05 12:47 PM


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