- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
½m²ß¥Î¨âÓ¤Gºû°}¦C,¤@Ó¤@ºû°}¦C³B²z
Sub TEST_20221214()
Dim Brr, C&, R&, T, Crr, N&
Brr = ¤u§@ªí1.UsedRange.Offset(1)
ReDim Crr(1 To UBound(Brr), 1 To UBound(Brr, 2))
T = Split("ABC,QWE,AA,BB", ",")
For R = 1 To UBound(Brr)
If (Brr(R, 2) = T(0) Or Brr(R, 2) = T(1)) And (Brr(R, 3) = T(2) Or Brr(R, 3) = T(3)) Then
If Trim(Brr(R, 5)) <> "" Then
N = N + 1
For C = 1 To UBound(Brr, 2)
Crr(N, C) = Brr(R, C)
Next
End If
End If
Next
¤u§@ªí2.UsedRange.Offset(3).Clear
With ¤u§@ªí2.[A4].Resize(N, UBound(Crr, 2))
.Value = Crr
.Sort key1:=.Item(1, 1), Header:=2, Orientation:=xlTopToBottom
End With
Set Brr = Nothing
Set Crr = Nothing
Erase T
End Sub |
|