Dear EF users,
Unfortunately I am unable to upload the whole code, but can simplify it descriptively:
I have a named range (ProductCode) of 100 rows and 1 column. Each cell (100 in total) is a string of the previous three cells:
=A145&" - "&B145&" - "& C145
Within a userform, more specifically a combobox (cboProductCode) there is a value which is searched for in this range:
Dim PC
With MAINDATA.Range("ProductCode")
Set PC = .Find(Me.cboProductCode.Value, LookIn:=xlValues)
If Not PC Is Nothing Then
COVER.Range("M60") = PC.Offset(0, -3).Value
End If
This means that cell M60 becomes the value of column A and row x, whereby row x is the first row in the named range where PC is found.
The problem I have is that I only would like to search in the first two digits of each row of the named range. These are a kind of identifier, if you wish. If the list is the following, it doesn't work. For example:
01 temp abc10
02 temp bcd11
03 temp cde12
" " "
10 temp jkl20
If PC = 10, then the search function returns 01 (the first column), because within that row it has found "10". If it only looks at the first two digits, then the result should be the 10th row.
I've tried looking at row A, but have run-time error 91 which I am unable to solve. I've tried Left(x, 2), but don't know how to correctly implement that in such a search. Does anyone have any smart solution for this?
Thanks a million!
Bookmarks