Afternoon
I have lovely working find function working but it searches on all columns. Now I have tried doing various changes to the range definition and also put in a selection restriction for column A.
The problem I'm having is that it is ignoring any restrictions and carries on it's own sweet way. The code is below and it uses two functions the first is Find and the second is Find Next.
Can someone give me a hand and advise how I can restrict the search to just column A of a spreadsheet.
Private Sub Find_Click()
Worksheets("Master").Activate
Dim strFind As String
Dim FirstAddress As String
Dim rSearch As Range
Set rSearch = Range("a1", Range(A:A).End(xlUp))
Dim f As Integer
strFind = Me.TextBox1.Value
With rSearch
Set c = .Find(strFind, LookIn:=xlValues)
If Not c Is Nothing Then
updateFields anchorCell:=c
FirstAddress = c.Address
Do
f = f + 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> FirstAddress
If f > 1 Then
Select Case MsgBox("There are " & f & " instances of " & strFind, vbOKCancel Or vbExclamation Or vbDefaultButton1, "Multiple entries")
Case vbOK
Case vbCancel
End Select
End If
Else: MsgBox strFind & " not listed"
End If
End With
Thanks