|
本帖最后由 379052149 于 2019-4-21 19:18 编辑
VBA小白求助,求大神帮助,跪拜!!!
Sub L()
Application.ScreenUpdating = False
Dim EndRow As Single
EndRow = Range("a65535").End(xlUp).Row
i = 2
While i <= EndRow
If Cells(i, 1) = "Dischage" Or Cells(i, 5) = "SKR" Or Cells(i, 5) = "TSL" _
Or Cells(i, 5) = "COS" Or Cells(i, 5) = "ZIM" Or Cells(i, 5) = "CSE" Or Cells(i, 5) = "IAL" Or Cells(i, 5) = "KMT" Or Cells(i, 5) = "HMM" _
Or Cells(i, 5) = "CUL" Or Cells(i, 2) = "R" Or Cells(i, 5) = "ONE" Or Cells(i, 8) = "MEA3" And Cells(i, 5) = "HLC" Or Cells(i, 8) = "CGX" And Cells(i, 5) = "YML" _
Or Cells(i, 8) = "JTS" And Cells(i, 5) = "YML" Or Cells(i, 8) = "CAT" And Cells(i, 5) = "YML" Or Cells(i, 8) = "CAT" And Cells(i, 5) = "YML" Or _
Cells(i, 8) = "CTI" And Cells(i, 5) = "YML" Or Cells(i, 8) = "JSM2" And Cells(i, 5) = "YML" Or Cells(i, 8) = "CHX" And Cells(i, 5) = "YML" _
Or Cells(i, 8) = "CPX" And Cells(i, 5) = "YML" Or Cells(i, 8) = "MD2" And Cells(i, 5) = "YML" Or Cells(i, 8) = "AIS" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "ANX" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "APG" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "JCV2S" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "JCV2N" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "EXT1" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "KCVS" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "KCVN" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "WSA2" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "MEXW" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "NE7" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "NTEN" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "TPF" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "NSC" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "CI3" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "JTS" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "NSA" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "JCVN" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "NCT" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "SCT3" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "MEA3" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "NS1" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "CI1" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "CI2" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "KSS" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "CV3" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "CS1" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "CIX" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "JST" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "CTK" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "JKH" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "SCM" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "SES" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "NSCT1" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "NTES" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "ACSAI" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "WSA4" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "WAX" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "NS5" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "PMX" And Cells(i, 5) = "WHL" Or Cells(i, 8) = "AR1" And Cells(i, 5) = "WHL" _
Or Cells(i, 8) = "CCS" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "CAT" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "STA" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "CNS" And Cells(i, 5) = "PIL" _
Or Cells(i, 8) = "SW2" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "NCS" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "CVT" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "MEA3" And Cells(i, 5) = "PIL" _
Or Cells(i, 8) = "CM5" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "NEU3" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "FES" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "ASA" And Cells(i, 5) = "PIL" _
Or Cells(i, 8) = "A3S" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "PIX" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "PM2" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "AGX WB" And Cells(i, 5) = "PIL" _
Or Cells(i, 8) = "CM3" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "CI2" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "CI1" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "RSSW" And Cells(i, 5) = "PIL" _
Or Cells(i, 8) = "CMSE" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "CMSW" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "SPS" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "WSA2" And Cells(i, 5) = "PIL" _
Or Cells(i, 8) = "WS2" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "SSA" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "RSS" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "RES" And Cells(i, 5) = "PIL" _
Or Cells(i, 8) = "NS1" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "PMX" And Cells(i, 5) = "PIL" Or Cells(i, 8) = "RES1" And Cells(i, 5) = "PIL" Then
Rows(i).Delete
Else
i = i + 1
End If
Wend
Application.ScreenUpdating = True
End Sub
IF后面的条件写短一点,在线等!!谢谢各位大神。 |
|