SanguineSleet
New Member
- Joined
- Aug 10, 2018
- Messages
- 5
Hi there,
I am running a find and search function on a column of data on a simple Macro I have created. However I seemed to be getting error 91 when it is encountering data that it cannot find.
My current code is:
Range("I:I").Select
Columns("I:I").Select
Selection.Find(What:="1", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Replace What:="1", Replacement:="Revocable", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Find(What:="2", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Replace What:="2", Replacement:="Irrevocable", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
However when I have data that does not have "2" in the I column it will stop and error.
Any help would be greatly appreciated!
Thanks
I am running a find and search function on a column of data on a simple Macro I have created. However I seemed to be getting error 91 when it is encountering data that it cannot find.
My current code is:
Range("I:I").Select
Columns("I:I").Select
Selection.Find(What:="1", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Replace What:="1", Replacement:="Revocable", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("I:I").Select
Selection.Find(What:="2", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Replace What:="2", Replacement:="Irrevocable", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
However when I have data that does not have "2" in the I column it will stop and error.
Any help would be greatly appreciated!
Thanks