我想浏览 L 列并将包含这些文本字段的单元格替换为 0。如果不是,我想保持原样。代码运行但在#N/A
它遇到的第一个停止。
Sub Drops()
Dim i&, z&
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
With Sheets("Input")
i = .Cells(Rows.Count, "L").End(xlUp).Row
For z = i To 2 Step -1
If (.Cells(z, "L").Value2 Like "*Customer Dropoff*" _
Or .Cells(z, "L").Value2 Like "*RE-Ships No pick up charge*" _
Or .Cells(z, "L").Value2 Like "*Undeliverable Publication Mail (NO P/U CHARGE)*" _
Or .Cells(z, "L").Value2 Like "*RETURNS*" _
Or .Cells(z, "L").Value2 Like "*K2 Fed Ex*" _
Or .Cells(z, "L").Value2 Like "*WorldNet Shipping*" _
Or .Cells(z, "L").Value2 Like "*OSM (NO P/U COST)*" _
Or .Cells(z, "L").Value2 Like "*TEST PICK UP*") Then
.Cells(z, "L").Value2 = 0
End If
Next z
z = .Cells(Rows.Count, "L").End(xlUp).Row
End With
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
MsgBox i - z & " Rows has been changed!"
End Sub