Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default VBA to find a value in a list

My workbook prompts the user for his/her password via a macro using InputBox.

password = InputBox("Please enter your password")

Once entered, I need a macro to find that password in the hidden "Roster"
sheet of 200 users and return the user's name that is located in the next
column over.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default VBA to find a value in a list

With Worksheets("Roster").Range("A1:A200")
On Error Resume Next
Set cell = .Find(pWord, LookIn:=xlValues)
On Error Goto 0
If Not cell Is Nothing Then
MsgBox "Name is " & cell.Offset(0, 1).Value
Else
MsgBox "Invalid password"
End If
End With

--
HTH

Bob Phillips

"Bill_S" wrote in message
...
My workbook prompts the user for his/her password via a macro using

InputBox.

password = InputBox("Please enter your password")

Once entered, I need a macro to find that password in the hidden "Roster"
sheet of 200 users and return the user's name that is located in the next
column over.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default VBA to find a value in a list

I am just wondering if there is'nt some problem with your scheme. Normally
one would look up a login name with the corresponding password in a hidden
sheet and then compare that password with the supplied password.

In your system how will you ensure that the passwords are unique? This is
obviously required if for each password you want your routine to find a
specific user name. If you try and ensure uniqueness at the time users are
setting their passwords then what if the password cannot be set and the user
gets the message "This password is already in use and cannot be chosen.
Choose another" then would'nt that user know that the password which failed
is a valid password?

Alok Joshi

"Bill_S" wrote:

My workbook prompts the user for his/her password via a macro using InputBox.

password = InputBox("Please enter your password")

Once entered, I need a macro to find that password in the hidden "Roster"
sheet of 200 users and return the user's name that is located in the next
column over.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA to find a value in a list

Getting enough answers?

--
Regards,
Tom Ogilvy


"Bill_S" wrote in message
...
My workbook prompts the user for his/her password via a macro using

InputBox.

password = InputBox("Please enter your password")

Once entered, I need a macro to find that password in the hidden "Roster"
sheet of 200 users and return the user's name that is located in the next
column over.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default VBA to find a value in a list

thank you Bob!


"Bob Phillips" wrote:

With Worksheets("Roster").Range("A1:A200")
On Error Resume Next
Set cell = .Find(pWord, LookIn:=xlValues)
On Error Goto 0
If Not cell Is Nothing Then
MsgBox "Name is " & cell.Offset(0, 1).Value
Else
MsgBox "Invalid password"
End If
End With

--
HTH

Bob Phillips

"Bill_S" wrote in message
...
My workbook prompts the user for his/her password via a macro using

InputBox.

password = InputBox("Please enter your password")

Once entered, I need a macro to find that password in the hidden "Roster"
sheet of 200 users and return the user's name that is located in the next
column over.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default VBA to find a value in a list

Tom,
Thanks for your "other" reply, so quickly. Yeah, I had to leave for a
meeting and it was essential that I have a solution upon returning, so I
thought I'd pursue a couple of different avenues.

"Tom Ogilvy" wrote:

Getting enough answers?

--
Regards,
Tom Ogilvy


"Bill_S" wrote in message
...
My workbook prompts the user for his/her password via a macro using

InputBox.

password = InputBox("Please enter your password")

Once entered, I need a macro to find that password in the hidden "Roster"
sheet of 200 users and return the user's name that is located in the next
column over.




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
How to find a find a list of possible inputs to sum a known amt? JimBunch Excel Discussion (Misc queries) 2 February 18th 06 05:17 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM
find names on list 1 in list 2. list 1 4000 names list 2 400 name Ed Excel Worksheet Functions 1 September 4th 05 12:48 AM
How to find and list duplicate values in a list? Stefan[_6_] Excel Programming 1 May 14th 04 01:09 PM
How to find and list duplicate values in a list? Stefan[_6_] Excel Programming 1 May 14th 04 12:58 PM


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