- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 10# 198188
°Ñ¦Ò¬Ý¬Ý , §Q¥Î¶i¶¥¿z¿ï°µªº
test.zip (19.54 KB)
- Sub myFilter()
- Dim rngSrc As Range, rngCopyField As Range, rngFilter As Range
- Dim nextRow As Long, endRow As Long
-
- Set rngSrc = Sheets("¸ê®Æ®w").[A1:G7]
- Set rngCopyField = Sheets("±ø¥ó°Ï").[B8:H8]
- Set rngFilter = Sheets("±ø¥ó°Ï").[B1].Resize(Sheets("±ø¥ó°Ï").[B1].CurrentRegion.Rows.Count, 8)
-
- nextRow = Sheets("¾ã²z°Ï").UsedRange.Rows.Count + 1
-
- rngSrc.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
- rngFilter, CopyToRange:=Sheets("¾ã²z°Ï").Range("A" & nextRow)
-
- endRow = Sheets("¾ã²z°Ï").UsedRange.Rows.Count
-
- For i = 1 To rngCopyField.Count
- If rngCopyField(i) = "N" Then
- Sheets("¾ã²z°Ï").Range(nextRow & ":" & endRow).Columns(i).Clear
- End If
- Next
-
- Sheets("¾ã²z°Ï").Range("A" & nextRow).Resize(1, 7).Delete Shift:=xlUp 'delete header
-
- Set rngSrc = Nothing
- Set rngCopyField = Nothing
- Set rngFilter = Nothing
- End Sub
½Æ»s¥N½X |
|