VBA: Function Help... Search?/Match?/Vlookup?/

M

Mcasteel

Im trying to look up a specific SSN from Column F. The End-User wil
input a Customer SSN that they are looking for into a text bo
(txtCustSSN).

If the SSN is found, I want to return the customers Lname, Fname
Info1, and Info2 back to my customized form. If the SSN is not found
want to return msgbox "Customer Data not Found".

_Data:_
Column A = Date
Column B = Type
Column C = Lname
Column D = Fname
Column E = Mname
Column F = SSN
Column G = Info1
Column H = Info2

ANY IDEAS ON HOW TO SEARCH A COLUMN OF OR 300+ SSN'S TO \"MATCH\" TH
SSN THAT THE END-USER INPUTS INTO THE TEXT BOX TXTCUSTSSN

Ive been having a really hard time with this, please respond with a
much info as you can.

Thank you
 
T

Tom Ogilvy

Private Sub CommandButton1_Click()
Dim rng as Range
With Worksheets(1)
set rng = .Columns(6).Find( _
Textbox1.Text)
if not rng is nothing then
txtLname.Text = .Cells(rng.row,3).Value
txtFname.Text = .Cells(rng.row,4).Value
' as so forth
Else
msgbox "Customer Data not found"
End if
End With
End Sub
 
M

MJ

Can you post the solution? I am trying to do something similar...
look at a value in a cell and see if it already exists in another
column.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top