column A > list of numbers(codes)
column B > list of name(of products) assigned with code in column A
i generate a code from different choice what i select in another provision in excel(same sheet)
now required(generated) code to be find is like 12300456000. here all zero are variables(0 shows that any value at that place is acceptable).. means i want to find ALL codes from column A having 123XX456XXX, here XX and XXX are variables. also its position can be changed. i.e. another required code may be 1XX23456XXX.
i want the list of the all product having codes similar to required i.e. like 123XX456XXX.
[ i used VLOOKUP but it gives only one result n0t all and it can not search for variables].
thank you in advance..
I answered this. Not sure why it's still here. You need a user-defined VBA function. If cell F1 contains the pattern and A1:A100 contains the range of test numbers, you can enter this in a cell:
and fill down.
Here's the function:
Public Function GetLike(Rg As Range, Pattern As String, whichOne As Integer)
Dim Check As String, n As Integer
Check = Application.Substitute(Pattern, "0", "?")
GetLike = ""
For Each thing In Rg
If thing Like Check Then
n = n + 1
If n = whichOne Then
GetLike = thing
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here