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

·s¼W¤@­Ó¬Û¦PªºIF§P§O¦¡¡A°õ¦æµ²ªG©M­×§ï«e¤@¼Ë¡H

·s¼W¤@­Ó¬Û¦PªºIF§P§O¦¡¡A°õ¦æµ²ªG©M­×§ï«e¤@¼Ë¡H

¥»©«³Ì«á¥Ñ av8d ©ó 2013-6-17 11:01 ½s¿è

­×§ï«e
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.   Dim Rng As Range, I As Integer
  3.   With Target
  4.     '.Select   '¦h¤@¦¸½T»{
  5.     If .Column = 4 Or .Column = 12 Then
  6.         If Cells(.Row, 4) <> "" And Cells(.Row, 12) <> "" Then
  7.             For I = 1 To Cells(Rows.Count, .Column).End(xlUp).Row
  8.                 If Cells(I, 4) = Cells(.Row, 4) And Cells(I, 12) = Cells(.Row, 12) And I <> .Row Then
  9.                     If Rng Is Nothing Then
  10.                         Set Rng = Union(Cells(I, 4), Cells(I, 12))
  11.                     Else
  12.                         Set Rng = Union(Rng, Cells(I, 4), Cells(I, 12))
  13.                     End If
  14.                 End If
  15.             Next
  16.             If Not Rng Is Nothing Then
  17.                 Set Rng = Union(Rng, Cells(.Row, 4), Cells(.Row, 12))
  18.                 Rng.Select
  19.                 'MsgBox Cells(.Row, 4) & vbNewLine & Cells(.Row, 12) & vbNewLine & "¥X²{­«½Æ "
  20.                 UserForm2.Show
  21.             End If
  22.         End If
  23.     End If
  24.   End With
  25.   
  26.     If Target.Cells.Count > 1 Then Exit Sub
  27.         If Union(Target, [K:K]).Address <> [K:K].Address Then Exit Sub
  28.         If Target = "¬õ¦â" Then
  29.         UserForm1.Show
  30.     End If
  31. End Sub
½Æ»s¥N½X
­×§ï«á
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.   Dim Rng As Range, I As Integer
  3.   With Target
  4.     '.Select   '¦h¤@¦¸½T»{
  5.     If .Column = 4 Or .Column = 12 Then
  6.         If Cells(.Row, 4) <> "" And Cells(.Row, 12) <> "" Then
  7.             For I = 1 To Cells(Rows.Count, .Column).End(xlUp).Row
  8.                 If Cells(I, 4) = Cells(.Row, 4) And Cells(I, 12) = Cells(.Row, 12) And I <> .Row Then
  9.                     If Rng Is Nothing Then
  10.                         Set Rng = Union(Cells(I, 4), Cells(I, 12))
  11.                     Else
  12.                         Set Rng = Union(Rng, Cells(I, 4), Cells(I, 12))
  13.                     End If
  14.                 End If
  15.             Next
  16.             If Not Rng Is Nothing Then
  17.                 Set Rng = Union(Rng, Cells(.Row, 4), Cells(.Row, 12))
  18.                 Rng.Select
  19.                 'MsgBox Cells(.Row, 4) & vbNewLine & Cells(.Row, 12) & vbNewLine & "¥X²{­«½Æ "
  20.                 UserForm2.Show
  21.             End If
  22.         End If
  23.     End If
  24.   End With
  25.   
  26.     If Target.Cells.Count > 1 Then Exit Sub
  27.         If Union(Target, [K:K]).Address <> [K:K].Address Then Exit Sub
  28.         If Target = "¬õ¦â" Then
  29.         UserForm1.Show
  30.     End If
  31.    
  32.     If Target.Cells.Count > 1 Then Exit Sub
  33.         If Union(Target, [K:K]).Address <> [K:K].Address Then Exit Sub
  34.         If Target = "ÂŦâ" Then
  35.         UserForm3.Show
  36.     End If
  37. End Sub
½Æ»s¥N½X
´ú¸Õµ²ªG¡GUserForm1©MUserForm2¦³¥X¨Ó¡A·s¼WªºUserForm3¨S¥X¨Ó¡C

        À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