Help with search code

M

Mekinnik

I need some help in making this line of code search just the left 3
characters of column 'M' starting with cell 2-5000.'T' represents
CbxDept.text and column 'M' holds an alphanumeric number that is automaticlly
created so the first 2 to 3 characters are letters. This line is suppose to
find all the rows that match 'T' and setup to copy all the matching data to
another sheets to use as a report.

Sheets("ProCode").Columns(13).Find(What:=T, After:=Cells(5000, 13),
LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True).Activate
 
G

Gary Keramidas

maybe this can get you started. post back with more details.

Option Explicit

Sub test()
Dim ws As Worksheet
Dim rngfound As Range
Set ws = Worksheets("ProCode")
With ws.Columns(13)
Set rngfound = .Find(What:="T", after:=Cells(5, 13), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True)
End With
MsgBox rngfound.Address
End Sub
 

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