ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Name checking (https://www.excelbanter.com/excel-programming/383707-name-checking.html)

[email protected]

Name checking
 
I had a list in Row A that goes straight down---say 20 given names .
And I am asking the user to input a name.The system checks THE
INPUTtED NAME and then goes to show me if "it is" there or it is
"not" with a message. I am getting some problems with the coding that
I wrote. USing VBA---any help would be good...Thanks...


Vergel Adriano[_2_]

Name checking
 
Maybe something like this:


Dim r As Range
Dim strName As String

strName = InputBox("Enter a name")

Set r = Range("A2:A4").Find(strName)

If r Is Nothing Then
MsgBox strname & " not found!"
Else
MsgBox strname & " found in " & r.Address
End If




wrote in message
ps.com...
I had a list in Row A that goes straight down---say 20 given names .
And I am asking the user to input a name.The system checks THE
INPUTtED NAME and then goes to show me if "it is" there or it is
"not" with a message. I am getting some problems with the coding that
I wrote. USing VBA---any help would be good...Thanks...




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


All times are GMT +1. The time now is 08:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com