jcaptchaos2
Well-known Member
- Joined
- Sep 24, 2002
- Messages
- 1,032
- Office Version
- 365
- Platform
- Windows
I need some help in where a person could type a word or number in a cell say cell "A1" and then have it search a database in columns A:I and then put every row from the database that contains that word or number starting in "A3". So if I typed the word file in "A1" all the rows that contain the word file would populate starting in 'A3" I have been messing with this code that will only search column a and I can't figure out how to have it look at a cell anyway but this kinda does what I want but only pulls 1 line. Could someone steer me in the right direction.
Code:
Public Sub FindITEM()
Dim aRange As Range
Set aRange = Range("A1:i122").Find(what:="12105", LookAt:=xlWhole, LookIn:=xlValues)
If aRange Is Nothing Then
MsgBox "Data not found"
Exit Sub
Else
aRange.Resize(1, 9).Copy Destination:=Range("N1")
End If
End Sub