Hi All,
Have got some code that was basically created by someone on this forum, was wondering if it could be updated a bit?
This is the original post: http://www.ozgrid.com/forum/showthread.php?t=35328
And this is my current code:
Code
For Each ws In ActiveWorkbook.Worksheets
'ignore hidden sheets
If ws.Visible = True Then
Application.StatusBar = "Searching " & ws.Name & "..."
Set rSearch = ws.UsedRange
With rSearch
Set c = .find(MyInput, LookIn:=xlValues, SearchOrder:=xlRows)
If Not c Is Nothing Then
count = count + 1: ff = c.Address
ReDim Preserve wsName(1 To count): wsName(count) = ws.Name
ReDim Preserve rng(1 To count): rng(count) = c.Address(0, 0)
Do
Set c = .FindNext(c)
If Not c Is Nothing Then
If c.Address = ff Then
Exit Do
Else
count = count + 1
ReDim Preserve wsName(1 To count): wsName(count) = ws.Name
ReDim Preserve rng(1 To count): rng(count) = c.Address(0, 0)
End If
End If
Loop
ff = Empty
End If
End With
End If
Next
Display More
Having found the first occurence of the MyInput, I want the code to stop looking in that row, and look in only the rows below. I am guesing this must be something to do with the FindNext part, but cant see where or what!
Many thanks for any help
Alastair