similar function to LOOKUP?

  • Thread starter Thread starter Kieran1028
  • Start date Start date
K

Kieran1028

I need a function that will return a cell value from a search of cel
contents.

For example, I have a column that has numbers from 1 to 2000. I wan
to know which cell contains the number 500 (cells are not necessaril
in order) so I can use that cell reference in a formula. Is there
function like this?

thanks,
-Kiera
 
how about something like this...

* replace txtCustSSN with 500 or use a varialbe here.


Dim rng As Range

With Worksheets(1)
Set rng = .Columns(6).Find(txtCustSSN.Text)

If Not rng Is Nothing Then
'Populate frmCustLookup with Customer Information
lblLname.Caption = .Cells(rng.Row, 3).Value
lblFname.Caption = .Cells(rng.Row, 4).Value
lblMname.Caption = .Cells(rng.Row, 5).Value

Else: MsgBox "Customer Data Not Found"

End If

End With

End Su
 
Back
Top