如何validation单元格中是否存在string,如果不存在,则将其作为较大循环的一部分进行添加?

我想循环显示一个表格,并在列表中添加一个数字,如果它还不在那里(同时突出显示红色行中的所有3个单元格)给定的条件成立(C列/列B> .8)。 (鉴于下面,我想添加代码“4”任何地方C / B> .80和'4'是不是已经在代码。)

Codes BC 1 100 90 2 100 95 100 82 6 100 70 4 100 85 

我已经尝试了以下内容:

 Public Sub Testing() Dim ValA As Range Dim ValB As Range Dim ValC As Range Dim ColA As Long Dim ColB As Long Dim ColC As Long Dim i As Long Dim LastRow As Long 'Set Variables Set ValA = ActiveSheet.Rows(1).Find("Codes", lookat:=xlWhole) If Not ValA Is Nothing Then ColA = ValA.Column End If Set ValB = ActiveSheet.Rows(1).Find("B", lookat:=xlWhole) If Not ValB Is Nothing Then ColB = ValB.Column End If Set ValC = ActiveSheet.Rows(1).Find("C", lookat:=xlWhole) If Not ValC Is Nothing Then ColC = ValC.Column End If LastRow = ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row 'loop 'Since you cant have any 0's in a division calc: If ColC > 0 And ColB > 0 Then For i = 2 To LastRow If ActiveSheet.Cells(i, ColB).Value < 1 Or ActiveSheet.Cells(i, ColB) = "N/A" Then ActiveSheet.Cells(i, ColB).Interior.ColorIndex = 3 ActiveSheet.Cells(i, ColC).Interior.ColorIndex = 3 ElseIf ActiveSheet.Cells(i, ColC).Value > ActiveSheet.Cells(i, ColB).Value * 0.8 Then If Not ActiveSheet.Cells(i, ColA).Value.Find("4", lookat:=xlPart) Then ActiveSheet.Cells(i, ColC).Interior.ColorIndex = 3 ActiveSheet.Cells(i, ColB).Interior.ColorIndex = 3 ActiveSheet.Cells(i, ColA).Interior.ColorIndex = 3 ActiveSheet.Cells(i, ColA).Value = ActiveSheet.Cells(i, ColA).Value & " 4" End If End If Next i Else: MsgBox "Matches werent found for B and C" End If End Sub