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

¸ê®ÆÅçÃүవ¦h­«¿ï¾Ü¶Ü

¸ê®ÆÅçÃүవ¦h­«¿ï¾Ü¶Ü

½Ð°Ý¦U¦ì«e½ú¡G

¤@¯ë¸ê®ÆÅçÃÒ¡A³£¥u¯à±q¤U©Ô²M³æ¿ï¾Ü¤@¶µ
¦pªþ¥ó¡A§Ú¦pªG·Q¦bC2¿ï¾Ü¦w¥þ´U¸ò¦w¥þ¾c¡A¸ê®ÆÅçÃÒ¦n¹³°µ¤£¨ì
½Ð°Ý¦³¤ñ¸û¾A·íªº°µªk¶Ü¡HÅý§Ú¥i¥H±q²M³æ¥h¿ï¡A¤S¥i¥H¿ï¾Ü¦h¼Ë
ÁÂÁ¤j®a

¸ê®ÆÅçÃÒ.zip (27.77 KB)

¦^´_ 1# ClareWu
¸Õ¸Õ¬Ý:
  1. Option Explicit
  2. '½Æ»s³Q¤Ä¿ïªº ­Ó¤H¨¾Å@¨ã
  3. Private Sub CommandButton1_Click()
  4.     Dim Rng, rngB As Range, endRow, Row1 As Integer
  5.    
  6.     '±q [A65536] ¥Ñ¤U©¹¤W§ä, ª½¨ì§ä¨ì «DªÅ¥Õ®æ ¬°¤îªº Row(¦C¼Æ­È)
  7.     endRow = [A65536].End(xlUp).Row
  8.    
  9.     '²M°£ÄæC
  10.     [C2:C65536] = ""
  11.    
  12.     '³]©w rngB ªº½d³ò
  13.     Set rngB = [B2].Resize(endRow, 1)
  14.    
  15.     '¹ï©ó rngB ªº¨C¤@­Ó¦¨­û Rng ¨Ó»¡,
  16.     For Each Rng In rngB
  17.    
  18.         '¦pªG Rng ªº¥k¤@®æ¬O "v"
  19.         If Rng = "v" Then
  20.         
  21.             '«DªÅ¥Õ®æ ªº ¤U¤@®æ = ªÅ¥Õ®æ
  22.             Row1 = [C65536].End(xlUp).Row + 1
  23.             
  24.             'ÄæCªÅ¥Õ®æ ªº­È = Rng ªº¥ª¤@®æ ªº­È
  25.             Cells(Row1, 3) = Rng.Offset(0, -1)
  26.         End If
  27.     Next
  28. End Sub

  29. '§Q¥Î ÄæB ¤Ä¿ï­n½Æ»sªº¶µ¥Ø
  30. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  31.     Dim Rng, rngB As Range, endRow As Integer
  32.    
  33.     endRow = [A65536].End(xlUp).Row
  34.     Set rngB = [B1].Resize(endRow, 1)
  35.    
  36.     'Intersect(Target, rngB) ¥i±N SelectionChange
  37.     '©ÒIJ°Êªº¦³®Ä½d³ò­­¨î¦b rngB ¤¤,
  38.     'rngB Is Nothing¡÷ªí¥Ü rngB ¥¼³QIJ°Ê
  39.     'Not Intersect(Target, rngB) Is Nothing
  40.     '¡÷ ªí¥Ü rngB ³QIJ°Ê¤F(­t­t±o¥¿)
  41.     If Not Intersect(Target, rngB) Is Nothing Then
  42.         If Target = "v" Then
  43.             Target = ""
  44.         Else
  45.             Target = "v"
  46.         End If
  47.     End If
  48. End Sub
½Æ»s¥N½X

TOP

ÁÂÁ¦^ÂСA½Ð°Ý¬O¤£¬O¥u¯à¥ÎVB¤~¯à¹F¨ì³o­Ó¥\¯à¡H

TOP

¦^´_ 3# ClareWu
¸ê®ÆÅçÃÒ´N¬O¬°¤FÁקK¿é¤J¿ù»~©Ò³]­p
¦pªG½Æ¿ï­n¦s¤J¦P¤@Àx¦s®æ´N¥²¶·¨Ï¥ÎVBA»²§U
¦pªG¨Ì¼Ó¤W°Êµe¡A¨º´Nª½±µ¤@®æÂI¤@¦¸ÅçÃÒ¨Óªºª½±µ
­Y¬O©È­«½ÆÂI¿ï¡A´N¥[¤J¤@­Ó»²§UÄæ¦ì¡A±Æ°£¤w¸g³Q¿ï¹Lªº¸ê®Æ°µ²M³æ
play.gif
List.zip (8.47 KB)
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 1# ClareWu
ª½±µÂI¿ï ­n¿ï¨úªº¶µ¥Ø §ó¤è«K
  1. Option Explicit
  2. '½Æ»s³Q¤Ä¿ïªº ­Ó¤H¨¾Å@¨ã
  3. Private Sub CommandButton1_Click()
  4.     Dim Rng, rngA As Range, endRow, Row1 As Integer
  5.    
  6.     '±q [A65536] ¥Ñ¤U©¹¤W§ä, ª½¨ì§ä¨ì «DªÅ¥Õ®æ ¬°¤îªº Row(¦C¼Æ­È)
  7.     endRow = [A65536].End(xlUp).Row
  8.    
  9.     '²M°£ÄæC
  10.     [C2:C65536] = ""
  11.    
  12.     '³]©w rngA ªº½d³ò
  13.     Set rngA = [A2].Resize(endRow, 1)
  14.    
  15.     '¹ï©ó rngB ªº¨C¤@­Ó¦¨­û Rng ¨Ó»¡,
  16.     For Each Rng In rngA
  17.    
  18.         '¦pªG Rng ªº¥k¤@®æ¬O "v"
  19.         If Rng.Font.ColorIndex = 5 Then
  20.         
  21.             '«DªÅ¥Õ®æ ªº ¤U¤@®æ = ªÅ¥Õ®æ
  22.             Row1 = [C65536].End(xlUp).Row + 1
  23.             
  24.             'ÄæCªÅ¥Õ®æ ªº­È = Rng ªº¥ª¤@®æ ªº­È
  25.             Cells(Row1, 3) = Rng
  26.         End If
  27.     Next
  28. End Sub

  29. 'ª½±µ¤Ä¿ï­n½Æ»sªº¶µ¥Ø
  30. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  31.     Dim Rng, rngA As Range, endRow As Integer
  32.    
  33.     endRow = [A65536].End(xlUp).Row
  34.     Set rngA = [A1].Resize(endRow, 1)
  35.    
  36.     'Intersect(Target, rngA) ¥i±N SelectionChange
  37.     '©ÒIJ°Êªº¦³®Ä½d³ò­­¨î¦b rngA ¤¤,
  38.     If Not Intersect(Target, rngA) Is Nothing Then
  39.         If Target.Font.ColorIndex = 1 Then
  40.             Target.Font.ColorIndex = 5
  41.         Else
  42.             Target.Font.ColorIndex = 1
  43.         End If
  44.     End If
  45. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# Hsieh
Á¤j¡A§ÚªºVBÁÙ¦b«D±`«D±`§C¶¥¶¥¬q¡A§Ú¦³¤@­ÓÀÉ®×·Pı¦³ÂIÃø«×¡A§Ú¯à½Ð±zÀ°§Ú¬Ý¬Ý¶Ü¡H

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD