M
michaelberrier
I am using a macro based on the cells.find feature, and I want to make
it stop searching at a certain row. Otherwise, it always finds the
specific value back at the place where I entered it after the search
loops through the whole column. Here is the code I have:
Sub Look_Here1()
Dim FoundCell As Range
Dim WhatFor As Variant
WhatFor = ActiveSheet.Cells(7, 2).Value
Set FoundCell = Cells.Find(What:=WhatFor, after:=ActiveCell, _
SearchDirection:=xlNext, searchorder:=xlByRows,
_
MatchCase:=False)
FoundCell.Offset(0, -1).Select
ActiveCell.FormulaR1C1 = "X"
Selection.Offset(0, 4).Select
End Sub
Is there anything I can add to that to make it stop at, say, B990,?
Thanks.
it stop searching at a certain row. Otherwise, it always finds the
specific value back at the place where I entered it after the search
loops through the whole column. Here is the code I have:
Sub Look_Here1()
Dim FoundCell As Range
Dim WhatFor As Variant
WhatFor = ActiveSheet.Cells(7, 2).Value
Set FoundCell = Cells.Find(What:=WhatFor, after:=ActiveCell, _
SearchDirection:=xlNext, searchorder:=xlByRows,
_
MatchCase:=False)
FoundCell.Offset(0, -1).Select
ActiveCell.FormulaR1C1 = "X"
Selection.Offset(0, 4).Select
End Sub
Is there anything I can add to that to make it stop at, say, B990,?
Thanks.