I generate a string via vba lets name it "matchcodepartone" (that works.)
I also have a set list of matchcode which in the cells K:K
the matchcodes all look like this matchcodepartone-matchcodeparttwo
now i want to search all the matchcodes in K:K and find the one(s) with matchcodepartone in it.
Then I need to copy the text of the cell LEFT of the found cells to somewhere.
example:
matchodepartone is found in K230 and K415
i need the articlenumber for that matchcode which is located in I230 and I415
my code for that is this: (matchcode being the string i search for)
Code
'...
'Dim i,j as integer
'Dim matchcode as string
'create matchcode
Range("M:M").Delete
Range("N:N").Delete
j=0
For i = 1 To 999
If Cells(11, i).Text = "" Then
i = 998
End If
If InStr(Cells(11, i).Text, matchcode) > 0 Then
j = j + 1
Cells(13, j).Text= Cells(10, i).Value
If InStr(Cells(11, i).Text, "***") > 0 Then
Cells(14, j).Text= Cells(11, i).Value
End If
End If
Next i
'...
what should happen is: i should have a list of Articlenumbers taken out of I:I and put into M:M
what really happens: freeze up.
is there a way to make that more useable?
This post was edited by Hooo on Mar 11 2015 02:08am