ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

excel»E¥ú灯«ç¼Ë¤£¼vÅT­ì¨Ó®æ¦¡¤WªºÃC¦â

excel»E¥ú灯«ç¼Ë¤£¼vÅT­ì¨Ó®æ¦¡¤WªºÃC¦â

  1. Private Sub CheckBox1_Click()
  2. If CheckBox1.Value = False Then
  3. CheckBox1.Caption = "Ãö"
  4. ActiveSheet.Cells.Interior.ColorIndex = xlNone
  5. Else: CheckBox1.Caption = "¶}"
  6. End If
  7. End Sub
  8. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  9. If CheckBox1.Caption = "¶}" Then Call Spotlight(Target)
  10. End Sub
  11. Sub Spotlight(ByVal Target As Excel.Range)
  12. On Error Resume Next
  13. Cells.FormatConditions.Delete
  14. With Target.EntireColumn

  15.             .FormatConditions.Add xlExpression, , "=true"

  16.             .FormatConditions(1).Interior.ColorIndex = 20

  17.         End With

  18.         With Target.EntireRow

  19.             .FormatConditions.Add xlExpression, , "=true"

  20.             .FormatConditions(2).Interior.ColorIndex = 20

  21.         End With

  22. End Sub
½Æ»s¥N½X
«ç¼Ë¸Ñ¨MÃö±¼¤§«á¥i¥H§R°£»E¥ú¿O

Private Sub CheckBox1_Click()
If CheckBox1.Value = False Then
   CheckBox1.Caption = "Ãö"
  'ActiveSheet.Cells.Interior.ColorIndex = xlNone
  Cells.FormatConditions.Delete
Else: CheckBox1.Caption = "¶}"
End If
End Sub

TOP

Sub Spotlight(ByVal Target As Excel.Range)
Cells.FormatConditions.Delete
With Union(Target.EntireColumn, Target.EntireRow)
     .FormatConditions.Add xlExpression, , "=true"
     .FormatConditions(1).Interior.ColorIndex = 20
End With
End Sub

TOP

¦^´_ 2# ­ã´£³¡ªL
ÁÂÁ­ã¤j¤j
§Ú¸Õ¹L¥[¤W³o¤@¥y¡GCells.FormatConditions.Delete
¦ý¬O·|§â§Ú­ì¨Óªí®æ¤Wªº©Ò¥HÃC¦â³£§R°£¡A½Ð°Ý­ã¤j¬O¤£¬O¤£¯à³æ¿W§R°£»E¥ú¿Oªº¤Q¦r¦ì¡C

TOP

¦^´_ 4# coke373


¬õ¦â¨º¦æ§R°£

TOP

¦^´_ 5# ­ã´£³¡ªL
­ì¨Ó³o¼Ë§R°£¬õ¦â¨º¤@¦æ´N¥i¥H¤F¡CÁÂÁ­ã¤j¤j

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD