我尝试使用Select Case
功能Left
做contain(text in the cell)
会更好,但我不知道该怎么做但是不是&#39能够弄清楚如何做到这一点。
我尝试了以下内容:
Sub siteadd()
Dim x
Dim Pl
Dim Li
Sheets("ort").Select
Columns("F:F").Select
Selection.TextToColumns Destination:=Range("F1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 2), TrailingMinusNumbers:=True
NumRows = cells(Rows.Count, "j").End(xlUp).Row
For x = 2 To NumRows
Li = cells(x, 6).Value
Pl = cells(x, 40).FormulaR1C1 = "=Left(RC[40], 12)"
Select Case Li
Case "#N/A"
Select Case Pl
Case "asc aite Aad"
cells(x, 6).Value = "B"
End Select
End Select
Next x
End Sub