Hello,
This seems like an easy one but I have been searching and searching for similar code but just can't seem to find what I am looking for and get it to work.
Can someone please tell me how to Search my in active sheet, column G for the text value "My Text" and if "My Text" is found in any cell of column G, it runs the macro "My_Macro". If it does not find "My Text", it does nothing.
Any help would be appreciated as I have been struggling with this. I have code below that I think is close but I am missing something.
This seems like an easy one but I have been searching and searching for similar code but just can't seem to find what I am looking for and get it to work.
Can someone please tell me how to Search my in active sheet, column G for the text value "My Text" and if "My Text" is found in any cell of column G, it runs the macro "My_Macro". If it does not find "My Text", it does nothing.
Any help would be appreciated as I have been struggling with this. I have code below that I think is close but I am missing something.
VBA Code:
If (Range("G:G") = "My Text") Then
Application.Run "'" & ActiveWorkbook.Name & "'" & "!My_Macro"
End If
Last edited: