I have a column of data that I'm trying to search through for certain strings. After I find the string I want to add a new string to that cell.
Sub Scan()
Salesforce = "Fail - Incorrect % in Draft"
Calculation = "Fail - Incorrect Calculation "
Certification = "Fail - Missing Certification"
Documentation = "Fail - Missing Documentation"
Range(AD2).Select
Do
If InStr(1, "salesforce", "AMI", vbTextCompare) Then
ActiveCell.Select.Value = Salesforce & ActiveCell.Value
ElseIf InStr(1, "Inclusion", "non-taxable", vbTextCompare) Then
ActiveCell.Select.Value = Calculation & ActiveCell.Value
ElseIf InStr(1, "Missing", "ISAF", vbTextCompare) Then
ActiveCell.Select.Value = Certification & ActiveCell.Value
ElseIf InStr(1, "Documentation", "support", vbTextCompare) Then
ActiveCell.Select.Value = Documentation & ActiveCell.Value
End If
Loop Until IsEmpty(ActiveCell) And IsEmpty(ActiveCell.Offset(1, 0))
Var = CellLoop()
End Sub
Here is the code for my CellLoop to iterate through rows.
Public Function CellLoop()
Dim c As Range
Dim rng As Range
Set rng = Selection
cnt = 1
For Each c In rng
c = cnt
cnt = cnt + 1
Next
End Function