- ©«¤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
|
¦^´_ 1# king0331
½×¾Â¤¤·j¯Á FormatConditions
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim Rng As Range, A As Range, k As Integer, F As Integer
- Dim CC As Range, C As FormatCondition
- Set Rng = Range("d2:k9").Columns
- For Each A In Rng
- k = 0
- For Each CC In A.Cells
- For Each C In CC.FormatConditions
- Select Case C.Type
- Case 1 '®æ¦¡¤Æ±ø¥ó: Àx¦s®æªºÈ
- F = C.Formula1
- Select Case C.Operator
- Case 1 '>= AND <=
- If CC.Value >= F And CC.Value <= Val(C.Formula2) Then k = 1
- Case 2 '< or >
- If CC.Value < F Or CC.Value > Val(C.Formula2) Then k = 1
- Case 3 '=
- If CC.Value = F Then k = 1
- Case 4 '<>
- If CC.Value <> F Then k = 1
- Case 5 '>
- If CC.Value > F Then k = 1
- Case 6 '<
- If CC.Value < F Then k = 1
- Case 7 '>=
- If CC.Value >= F Then k = 1
- Case 8 '<=
- If CC.Value <= F Then k = 1
- End Select
- Case 2 '®æ¦¡¤Æ±ø¥ó: ¤½¦¡
- If Application.Evaluate(C.Formula1) = True Then k = 1
- End Select
- Next
- If k = 1 Then GoTo OK
- Next
- OK:
- If k = 0 Then A.EntireColumn.Hidden = True
- Next
- End Sub
½Æ»s¥N½X |
|