View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
patrick molloy patrick molloy is offline
external usenet poster
 
Posts: 391
Default Can't Find Value

Public Function VerifyPW(Name As String) As Boolean
Dim rng As Range
Dim Found As Range



Set rng = Worksheets("Users").Columns("A:A")

Set Found = rng.Find(What:="dan", MatchCase:=True)

VerifyPW = Not (Found Is Nothing)

End Function




-----Original Message-----
ok, so i've updated my code and now it looks like this

Public Function VerifyPW(Name As String) As Boolean
Dim rng As Range
Dim Found As Range
Set rng = Worksheets("Users").Columns("A:A")
With rng
Set Found = .Find(What:="dan", MatchCase:=True)
End With

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

if i explicitly state What as "dan", it will find it

properly. However,
if i try to use my Name variable, it won't work anymore.

when I use my
name variable, i use What:=Name. Do i need to put name

inbetween some
kind of characters, like quotes, to let it know that its

a variable?


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

.