Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search column
I want to be able to type in a surname in a textbox called "surname" and I
want to see if there are any matches to this name on the sheet called "FULLNAMES" column A. Thanks Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search column
Try this:
Sub colsearch() Dim s As String s = Application.InputBox(prompt:="enter name", Type:=2) listt = "" With Sheets("FULLNAMES") n = .Cells(Rows.Count, "A").End(xlUp).Row For i = 1 To n v = .Cells(i, 1).Value If Len(v) = Len(Replace(v, s, "")) Then Else listt = listt & Chr(10) & i End If Next End With If listt = "" Then MsgBox ("not found") Else MsgBox ("found in rows:" & listt) End If End Sub -- Gary''s Student - gsnu2007a "Greg B" wrote: I want to be able to type in a surname in a textbox called "surname" and I want to see if there are any matches to this name on the sheet called "FULLNAMES" column A. Thanks Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search for a column based on the column header and then past data from it to another column in another workbook | Excel Programming | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Programming | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Discussion (Misc queries) | |||
Loop through column headers to search from column name and get cell range | Excel Programming | |||
URGENT -- search in string for a value in another column, if found, return value from next column | Excel Programming |