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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,214,942
Messages
6,122,367
Members
449,080
Latest member
Armadillos

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