如果A栏包含" RR"和C列不等于"备忘录"和E栏不等于" Air"或"印刷"列L = 0。
然后是如果列A包含" RR"和C列不等于"备忘录"和E栏等于" Air"或"印刷"然后列L =是列H * .1。
我相信我在使用equals / not equals时遇到了麻烦。
Sub RRClean()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim myString As String
RowCount = WorksheetFunction.CountA(range("A:A"))
For i = 2 To RowCount
myString = Trim(Cells(i, 2).Value)
If InStr(myString, "RR") > 0 And .cell(i, 3) <> "Memo" And .cell(i, 7) <> "Air" Or .cell(i, 7) <> "Printed" Then
Cells(i, 12).Value = 0
End If
Next
For i = 2 To RowCount
myString = Trim(Cells(i, 2).Value)
If InStr(myString, "RR") > 0 And .cell(i, 3) <> "Memo" And .cell(i, 7) = "Air" Or .cell(i, 7) = "Printed" Then
Cells(i, 12).Value = cell(i, 8) * 0.1
End If
Next
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
答案 0 :(得分:1)
在处理&#34时,您的逻辑存在轻微缺陷; E列不等于&#34; Air&#34;或&#34;印刷&#34;&#34; 。如果单元格不是 Air ,则可以打印。如果它不是 Printed 那么它可能是 Air 。您需要和,如&#34;并且E列不等于&#34; Air&#34;和E栏不等于&#34; Printed&#34; 。
http://localhost:4200/people?page[number]=1&page[size]=25
使用AutoFilter Method,可以在不声明单个变量的情况下完成这两项操作。