- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-10-24 06:55 ½s¿è
¦^´_ 5# united7878
¬O¥²¶·¸Ñ°£CÄæ»PIUÄæ©ÎLÄæMÄ椧¸ê®Æ»PÀx¦s³¡¤ÀÄæ¦ìªºÂê©w.
«OÅ@¤u§@ªí¦³³\¦h¿ï¶µ,¥i°Ñ¦ÒVBA»¡©ú, Protect ¤èªk.
½Ð¿ï¾Ü ±Æ§Ç,¨Ï¥Î¦Û°Ê¿z¿ï- Option Explicit
- Sub Ex()
- ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
- , AllowSorting:=True, AllowFiltering:=True
- End Sub
½Æ»s¥N½X
Ex_¶i¶¥¿z¿ï ¶·×§ï¤@¤U- Sub Ex_¶i¶¥¿z¿ï()
- Dim Rng(1 To 3) As Range
- '****************************************************************
- Set Rng(1) = [c3:c1002] '¸ê®Æ®w½d³ò: c3n¬O¬°¸ê®Æ®wªºÄæ¦ì¼ÐÀY
- '****************************************************************
- Set Rng(2) = [IU:IV] '¤u§@ªí³Ì«á²Ä2Äæ:¶i¶¥¿z¿ï,¸ê®Æ½Æ»s¨ì ªºÀx¦s®æ
- Set Rng(3) = [M4:N13] '©ñ¸m«Âг̦hªº«e10¦W ªºÀx¦s®æ
- Rng(2) = "" 'Rng(2)¥²»Ý¬O¨S¦³¸ê®Æ
-
- Rng(1).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Rng(2).Cells(1), Unique:=True
- '¶i¶¥¿z¿ï¤£«½Æªº¸ê®Æ(Unique:=True)
- With Rng(2)
- .Sort KEY1:=Rng(2).Range("a1"), Order1:=xlDescending, Header:=xlYes
- '½d³òªº¥Ñ¤j¨ì¤pªº±Æ§Ç(Order1:=xlDescending)
- End With
- With Range(Rng(2).Cells(1), Rng(2).Cells(1).End(xlDown))
- .Offset(1, 1).FormulaR1C1 = "=COUNTIF(" & Rng(1).Address(, , xlR1C1) & ",RC[-1])" '
- '¼g¤W¤u§@ªí¨ç¼ÆCOUNTIF
- End With
- With Rng(2)
- .Sort KEY1:=Rng(2).Range("b1"), Order1:=xlDescending, Header:=xlYes
- End With
- Rng(3) = Rng(2).Range("A2").Resize(10, 2).Value '¸ê®Æ½Æ»s
- End Sub
½Æ»s¥N½X |
|