ªð¦^¦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

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

TOP

¦^´_ 4# coke373


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

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

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

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

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD