Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a worksheet with about 1500 names and addresses in it.... one contact
per line. All the names are in cloumn B. What I want is a macro that will display an input box to get the name that I want to find in the list. When the user types in the name I want the screen to display that person's line in the list (database). I'd like to be able to enter a minimum of 1 letter... "M" for instance and have it select the first name beginning with "M". Sometimes I might enter more letters though. So it need to match whatever is entered in the input box. I know this can't be too hard, but I've messed around too long trying to get something to work and am getting nowhere. Any help would be greatly appreciated. Jon |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub findname()
LastRow = Cells(Rows.Count, "B").End(xlUp).Row Set namerange = Range(Cells(1, "B"), Cells(LastRow, "B")) SearchName = InputBox("Enter Name: ") Set c = namerange.Find(SearchName, LookIn:=xlValues) If Not c Is Nothing Then MsgBox ("Found name: " & c & _ " on line " & CStr(c.Row)) Else MsgBox ("Did not find: " & SearchName) End If End Sub "jonco" wrote: I have a worksheet with about 1500 names and addresses in it.... one contact per line. All the names are in cloumn B. What I want is a macro that will display an input box to get the name that I want to find in the list. When the user types in the name I want the screen to display that person's line in the list (database). I'd like to be able to enter a minimum of 1 letter... "M" for instance and have it select the first name beginning with "M". Sometimes I might enter more letters though. So it need to match whatever is entered in the input box. I know this can't be too hard, but I've messed around too long trying to get something to work and am getting nowhere. Any help would be greatly appreciated. Jon |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'll give that a shot. Thanks!
"jonco" wrote in message ... I have a worksheet with about 1500 names and addresses in it.... one contact per line. All the names are in cloumn B. What I want is a macro that will display an input box to get the name that I want to find in the list. When the user types in the name I want the screen to display that person's line in the list (database). I'd like to be able to enter a minimum of 1 letter... "M" for instance and have it select the first name beginning with "M". Sometimes I might enter more letters though. So it need to match whatever is entered in the input box. I know this can't be too hard, but I've messed around too long trying to get something to work and am getting nowhere. Any help would be greatly appreciated. Jon |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding a name with partial description and deleting all occurrenc | Excel Worksheet Functions | |||
FINDING PARTIAL ENTRIES IN A CELL/ARRAY | Excel Discussion (Misc queries) | |||
Finding the highest alphabetic name in a list of names | Excel Worksheet Functions | |||
Sumproduct and finding partial strings | Excel Programming | |||
Finding Partial Text in a Cell | Excel Worksheet Functions |