Error while using FindNext function

jishnu

New Member
Joined
Mar 25, 2019
Messages
15
I am using FindNext function to get the row information of cell containing a variable called 'MKB' .
my code is given below :

Sub LoopThroughSheets(MKB As Variant)
Dim findRng As Range
Dim firstRow As Long
Dim allFinds As String
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, lookat:=xlPart)


If Not findRng Is Nothing Then
firstRow = findRng.row
Do
MsgBox (firstRow)
Set findRng = .FindNext(findRng)
Loop While Not findRng Is Nothing And findRng.row <> firstRow


End If
End With




Next ws
Next j


End Sub

but vba editor shows an error message on the code line - 'Set findRng = .FindNext(findRng) ' saying "object does not support this property or method"..Please help !!!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You need to give FindNext a range expression. eg Range("A1:A10").FindNext etc. You are giving it a worksheet.
 
Upvote 0

Forum statistics

Threads
1,225,750
Messages
6,186,808
Members
453,373
Latest member
Ereha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top