View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Can't Find Value

Hi

You've declared
Dim Found As WorksheetFunction
but your code should return a range:
Dim Found As Range

(If you used Option Explicit on top of your modules then you'd receive a
helpful "Type mismatch" error.)

HTH. Best wishes Harald

"majikman " skrev i melding
...
i'm trying to search in a hidden worksheet that i've created for user
names. below is the code but it doesn't work. can someone please help
me out? btw, i'm really curious as to where i can find more information
about that find method and for that matter, all the method's that are
used in excel. the excel help file is very lacking in information. it
doesn't list nearly as many parameters for the find function as i've
seen in examples here in the forums.

Public Function VerifyPW(Name As String) As Boolean
Dim Found As WorksheetFunction
With Worksheets(5).Range("A1:A30")
Set Found = .Find(What:=Name, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=True)
End With

VerifyPW = Not (Found Is Nothing)
VerifyPW = True
End Function


---
Message posted from http://www.ExcelForum.com/