markstro
Board Regular
- Joined
- Sep 8, 2008
- Messages
- 106
the following VBA allows me to type in cell A6 what I want to find in the sheet. right now it searches the whole sheet, how can I narrow the search to a range and match exactly what is in A6. I have tried editing line 2 with a range and line 4 in a couple ways and can't get it.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
If Target.Address = "$A$6" Then
Set MyRange = Cells.Find(what:=Target.Value, After:=Target)
If Not MyRange Is Nothing Then MyRange.Select
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
If Target.Address = "$A$6" Then
Set MyRange = Cells.Find(what:=Target.Value, After:=Target)
If Not MyRange Is Nothing Then MyRange.Select
End If
End Sub