Hi,
I am working on creating code in which a comment provided in Column AB will return a specific comment in Column AJ, based on if Column AB contains a specific word/criteria. The issue I am having is that I need the code to be dynamic, in which only a word in Column AB would trigger an associated comment to be populated in Column AJ - For example, if Column AB has comments in rows 1, 10 and 15 for instance as "Auto-Uploader Tool Failed", "Autoloader Fail", "Auto-tool Failed Run", then the code should populate Column AJ rows 1, 10 and 15 with "Auto-Upload Tool Fail."
Here is my flawed code - I cannot seem to understand how to change the requirement for Column AB in which simply having the word (as from our example above) "auto" should return "Auto-Upload Tool Fail" in Column AJ. The code below shows that I need the exact wording from Column AB, in order for Column AJ to populate - I would like it so that the code only needs to recognize one word in Column AB to trigger Column AJ. Hope this makes sense!
Sub Comment()
For Each r In Intersect(ActiveSheet.UsedRange, Range("AB:AB"))
If r.Text = "Auto upload fail" Then
r.Offset(0, 8) = "Auto-Uploader Tool Fail"
End If
Next r
For Each r In Intersect(ActiveSheet.UsedRange, Range("AB:AB"))
If r.Text = "autoloader not working" Then
r.Offset(0, 8) = "Auto-Uploader Fail"
End If
Next r
End Sub
For Each r In Intersect(ActiveSheet.UsedRange, Range("AB:AB"))
If r.Text = "Technology Issue" Then
r.Offset(0, 8) = "Technology Issue - Unspecified"
End If
Next r
I am working on creating code in which a comment provided in Column AB will return a specific comment in Column AJ, based on if Column AB contains a specific word/criteria. The issue I am having is that I need the code to be dynamic, in which only a word in Column AB would trigger an associated comment to be populated in Column AJ - For example, if Column AB has comments in rows 1, 10 and 15 for instance as "Auto-Uploader Tool Failed", "Autoloader Fail", "Auto-tool Failed Run", then the code should populate Column AJ rows 1, 10 and 15 with "Auto-Upload Tool Fail."
Here is my flawed code - I cannot seem to understand how to change the requirement for Column AB in which simply having the word (as from our example above) "auto" should return "Auto-Upload Tool Fail" in Column AJ. The code below shows that I need the exact wording from Column AB, in order for Column AJ to populate - I would like it so that the code only needs to recognize one word in Column AB to trigger Column AJ. Hope this makes sense!
Sub Comment()
For Each r In Intersect(ActiveSheet.UsedRange, Range("AB:AB"))
If r.Text = "Auto upload fail" Then
r.Offset(0, 8) = "Auto-Uploader Tool Fail"
End If
Next r
For Each r In Intersect(ActiveSheet.UsedRange, Range("AB:AB"))
If r.Text = "autoloader not working" Then
r.Offset(0, 8) = "Auto-Uploader Fail"
End If
Next r
End Sub
For Each r In Intersect(ActiveSheet.UsedRange, Range("AB:AB"))
If r.Text = "Technology Issue" Then
r.Offset(0, 8) = "Technology Issue - Unspecified"
End If
Next r