I am trying to find the multiple row numbers in which a particular value is found inside.
In the code shown below, the red coloured line shows an error
and if i remove ' And findRng.row <> firstRow ' , it works but loops infinitely which is not what i wanted So it means only this portion has an issue.
Can anyone help me please !!
In the code shown below, the red coloured line shows an error
Rich (BB code):
Rich (BB code):
Rich (BB code):
Sub LoopThroughSheets()
Dim findRng As Range
Dim firstRow As Long
Dim row As Long
Dim allFinds As String
Dim numberOfRowsWithSameMKB As Integer
Workbooks(SYSDatei).Activate
For j = 0 To SizeOfMKB_array - 1
For Each ws In Workbooks(SYSDatei).Worksheets
wsName = ws.Name
With Workbooks(SYSDatei).Worksheets(wsName)
Set findRng = .UsedRange.Find(MKB_array(j), lookat:=xlPart)
If Not findRng Is Nothing Then
firstRow = findRng.row
MsgBox firstRow
Call SearchForPKZ(firstRow)
Do
Set findRng = .UsedRange.FindNext(findRng)
If Not findRng Is Nothing Then Call SearchForPKZ(findRng.row)
Loop While Not findRng Is Nothing And findRng.row <> firstRow
rowArray = Split(allFinds, ",")
numberOfRowsWithSameMKB = UBound(rowArray)
End If
End With
and if i remove ' And findRng.row <> firstRow ' , it works but loops infinitely which is not what i wanted So it means only this portion has an issue.
Can anyone help me please !!