SHIRLEY YEUNG
New Member
- Joined
- Jan 20, 2011
- Messages
- 8
Here is part of the codes. I want to use the statements to check if the email subject matches to any of the subjects saved in column K. It can execute without problem. However, email subject can vary from time to time, but still it should contains some key words unchanged. So I tried to use Like instead of = . But when I execute it hanged my Excel. Please give me some advice. Thanks!
Range("K2").Select
For Each A In Range(Selection, Selection.End(xlDown))
subjectVal = A.Value
If UCase(OSubject) = UCase(subjectVal) Then
ActiveCell.Offset(0, -7).Range("A1").Select
------------------------------------------------------
Range("K2").Select
For Each A In Range(Selection, Selection.End(xlDown))
subjectVal = A.Value
If UCase(OSubject) Like "*" & UCase(subjectVal) & "*" Then
ActiveCell.Offset(0, -7).Range("A1").Select
Range("K2").Select
For Each A In Range(Selection, Selection.End(xlDown))
subjectVal = A.Value
If UCase(OSubject) = UCase(subjectVal) Then
ActiveCell.Offset(0, -7).Range("A1").Select
------------------------------------------------------
Range("K2").Select
For Each A In Range(Selection, Selection.End(xlDown))
subjectVal = A.Value
If UCase(OSubject) Like "*" & UCase(subjectVal) & "*" Then
ActiveCell.Offset(0, -7).Range("A1").Select