Sorry! Tried to install the XL2BB addin but did not succeed after trying most of your recommendations.
Here is my question:
Running the macro Nxt standing in cell A1, with SearchValue C1 = "Coll", the SearchRange will become A1:A4 and the first match is found in A2.
It looks like Find does not start looking in A1.
However, running the macro standing in A4, the SearchRange becomes A4:1048576 and Find inconsequently finds a match in A4. How is it meant to work?
Sub Nxt()
Dim Found As Range, SearchRange As Range
Dim SearchValue As String, AdresseFound As String, SearchRangeValue As String
'looking in column A for the content of cell C1
SearchValue = Range("C1")
Set SearchRange = Range(ActiveCell.Offset(0, 0), ActiveCell.End(xlDown))
SearchRangeValue = SearchRange.Address
Set Found = SearchRange.Cells.Find(what:=SearchValue, LookAt:=xlPart)
' AdresseFunnet = Funnet.Address
If Found Is Nothing Then
AdresseFound = SearchValue & " does not exist in " & SearchRangeValue
' Call FindFirstBlankCell
Else
AdresseFound = Found.Address
Application.Goto Reference:=Found, Scroll:=True
End If
End Sub
Here is my question:
Running the macro Nxt standing in cell A1, with SearchValue C1 = "Coll", the SearchRange will become A1:A4 and the first match is found in A2.
It looks like Find does not start looking in A1.
However, running the macro standing in A4, the SearchRange becomes A4:1048576 and Find inconsequently finds a match in A4. How is it meant to work?
Collet | Anne | Coll |
Collet | Chris | |
Collet | Mike | |
Collet | Pamela |
Sub Nxt()
Dim Found As Range, SearchRange As Range
Dim SearchValue As String, AdresseFound As String, SearchRangeValue As String
'looking in column A for the content of cell C1
SearchValue = Range("C1")
Set SearchRange = Range(ActiveCell.Offset(0, 0), ActiveCell.End(xlDown))
SearchRangeValue = SearchRange.Address
Set Found = SearchRange.Cells.Find(what:=SearchValue, LookAt:=xlPart)
' AdresseFunnet = Funnet.Address
If Found Is Nothing Then
AdresseFound = SearchValue & " does not exist in " & SearchRangeValue
' Call FindFirstBlankCell
Else
AdresseFound = Found.Address
Application.Goto Reference:=Found, Scroll:=True
End If
End Sub