ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find, Lookup, who knows??? (https://www.excelbanter.com/excel-programming/287100-find-lookup-who-knows.html)

Michael Kintner

Find, Lookup, who knows???
 
I have a list if items and wish to find and item by partical name. How can
I do this using VB code?

Item345 1 6
*Item124 2 7
Item346 3 9

I wish to do a VB search for "*Item" and return the values 2 and 7.

Note that in Column A I only wish to look at left$ 5 characters on the find.

Thank you for your help in advance!!! (smile)

Mike



Don Guillett[_4_]

Find, Lookup, who knows???
 
use vlookup or match/index function which can be used in vba
range("c1")=application.vlookup(item,range("a2:d40 0"),2,false)

or use find and offset in vba

--
Don Guillett
SalesAid Software

"Michael Kintner" wrote in message
...
I have a list if items and wish to find and item by partical name. How

can
I do this using VB code?

Item345 1 6
*Item124 2 7
Item346 3 9

I wish to do a VB search for "*Item" and return the values 2 and 7.

Note that in Column A I only wish to look at left$ 5 characters on the

find.

Thank you for your help in advance!!! (smile)

Mike





Michael Kintner

Find, Lookup, who knows???
 
But how can I do a partical search on a field, this only works it what I am
finding is the entire word.

How do I do a loop search inside of VB on an area?

Mike

"Don Guillett" wrote in message
...
use vlookup or match/index function which can be used in vba
range("c1")=application.vlookup(item,range("a2:d40 0"),2,false)

or use find and offset in vba

--
Don Guillett
SalesAid Software

"Michael Kintner" wrote in message
...
I have a list if items and wish to find and item by partical name. How

can
I do this using VB code?

Item345 1 6
*Item124 2 7
Item346 3 9

I wish to do a VB search for "*Item" and return the values 2 and 7.

Note that in Column A I only wish to look at left$ 5 characters on the

find.

Thank you for your help in advance!!! (smile)

Mike







Don Guillett[_4_]

Find, Lookup, who knows???
 
try this

Sub findfirstfive()
Dim myvar As String
myvar = "item1"
x = Range("e10:e112").Find(myvar, lookat:=xlPart).Address
MsgBox Range(x).Offset(, 1)
End Sub

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
use vlookup or match/index function which can be used in vba
range("c1")=application.vlookup(item,range("a2:d40 0"),2,false)

or use find and offset in vba

--
Don Guillett
SalesAid Software

"Michael Kintner" wrote in message
...
I have a list if items and wish to find and item by partical name. How

can
I do this using VB code?

Item345 1 6
*Item124 2 7
Item346 3 9

I wish to do a VB search for "*Item" and return the values 2 and 7.

Note that in Column A I only wish to look at left$ 5 characters on the

find.

Thank you for your help in advance!!! (smile)

Mike








All times are GMT +1. The time now is 11:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com