Johnatha
01-11-2016, 11:36 AM
Hi everyone,
I have successfully created a macro that searches for a specific string (for example, "EEOG"), and clears the contents of the cell 3 columns to the right of said string. My question is- how can I get my code to find ALL of said strings, and clear the contents of the cell 3 columns to the right, throughout my entire workbook? Right now it only finds 1 row that contains "EEOG" but not all the other rows.
Here is my working code:
Sub Macro1()
Cells.Find(What:="EEOG", LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False).Offset(, 3).Select
Selection.ClearContents
End Sub
Thanks :)
-Johnathan
I have successfully created a macro that searches for a specific string (for example, "EEOG"), and clears the contents of the cell 3 columns to the right of said string. My question is- how can I get my code to find ALL of said strings, and clear the contents of the cell 3 columns to the right, throughout my entire workbook? Right now it only finds 1 row that contains "EEOG" but not all the other rows.
Here is my working code:
Sub Macro1()
Cells.Find(What:="EEOG", LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False).Offset(, 3).Select
Selection.ClearContents
End Sub
Thanks :)
-Johnathan