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

[µo°Ý] worksheet ¨Æ¥ó¾É­PµLªk½Æ»s¶K¤W

[µo°Ý] worksheet ¨Æ¥ó¾É­PµLªk½Æ»s¶K¤W

§Úªº2­Ó¤u§@ªí³£¦³¦p¤U¤@¼Ëªºµ{¦¡½X¡A¤£ª¾¹D¬O­þ¸Ì¦³°ÝÃD¾É­P§Ú­n¦b¨â­Ó¤u§@ªí¤§¶¡µLªk¶i¦æ½Æ»s¶K¤W¡A§Ú¦³§âµ{¦¡µù¸Ñ±¼¸Õ¡Aµ²ªG¬O¥i¥H½Æ»s¶K¤Wªº
¤£ª¾¹D¦³¨S¦³¤Hª¾¹D¬O­þ¸Ì¥X¤F°ÝÃD???
§Ú¤]¦³¬d¨ìApplication.EnableEvents = False¡AApplication.EnableEvents = True¡Aªº¥Îªk¡A¦ý·|Åܦ¨§Úªºµ{¦¡½X¨S¿ìªk¥Î¡C
§Æ±æ¦³°ª¤â¯àÀ°À°¦£@@
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.     If Target Is Nothing Then Exit Sub
  3.     If Target.Count > 1 Then Exit Sub
  4.     If [A37].Value <> "" Then
  5.         Range("C39").Value = Range("C3").Value
  6.         Range("I39").Value = Range("I3").Value
  7.         Range("C42").Value = Range("C6").Value
  8.         Range("C43").Value = Range("C7").Value
  9.         Range("I41").Value = Range("I5").Value
  10.         Range("I42").Value = Range("I6").Value
  11.         Range("I43").Value = Range("I7").Value
  12.         Range("I44").Value = Range("I8").Value
  13.         Range("C72").Value = Range("C36").Value
  14.         Range("B69").Value = Range("B33").Value
  15.     End If
  16.     If [F11] = "" Then Exit Sub
  17.     If [F11] <> "" Then Application.MoveAfterReturnDirection = xlToRight
  18.     If Target.Column = 11 Then Target(2, -4).Select
  19. End Sub

  20. Private Sub Worksheet_Change(ByVal Target As Excel.Range)
  21.     Dim SelRng As Range
  22.     Set SelRng = Application.Intersect([F11:J31,F47:J67], Target)
  23.     If SelRng Is Nothing Then Exit Sub
  24.         If SelRng.Count > 1 Then Exit Sub
  25.         If SelRng & "" = "0" Then
  26.            SelRng = "OK"
  27.         ElseIf SelRng & "" = "." Then
  28.            SelRng = "N/A"
  29.         End If
  30. End Sub
½Æ»s¥N½X
test1.rar (15.14 KB)

ª©¥»¬O excel 2007

TOP

¤w¸Ñ¨M~~
'   Application.EnableEvents = False  °±¤îIJµo¨Æ¥ó
'   Application.EnableEvents = True   ­«·s±Ò°Ê¨Æ¥ó
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.     Dim Sel As Range
  3.     Set Sel = Application.Intersect([K:K], Target)
  4.     If Sel Is Nothing Then GoTo ena
  5.     If Sel.Count > 1 Then GoTo ena
  6.     If [A37].Value <> "" Then
  7.         Range("C39").Value = Range("C3").Value
  8.         Range("I39").Value = Range("I3").Value
  9.         Range("C42").Value = Range("C6").Value
  10.         Range("C43").Value = Range("C7").Value
  11.         Range("I41").Value = Range("I5").Value
  12.         Range("I42").Value = Range("I6").Value
  13.         Range("I43").Value = Range("I7").Value
  14.         Range("I44").Value = Range("I8").Value
  15.         Range("C72").Value = Range("C36").Value
  16.         Range("B69").Value = Range("B33").Value
  17.     End If
  18.     If [F11] = "" Then Exit Sub
  19.     If [F11] <> "" Then Application.MoveAfterReturnDirection = xlToRight
  20.     If Sel.Column = 11 Then
  21.         Application.EnableEvents = False
  22.         Target(2, -4).Select
  23.     End If
  24. ena:
  25.     Application.EnableEvents = True
  26. End Sub

  27. Private Sub Worksheet_Change(ByVal Target As Range)
  28.     Dim SelRng As Range
  29.     Set SelRng = Application.Intersect([F11:J31,F47:J67], Target)
  30.     If SelRng Is Nothing Then GoTo en
  31.     If SelRng.Count > 1 Then GoTo en
  32.     If SelRng & "" = "0" Then
  33.        SelRng = "OK"
  34.     ElseIf SelRng & "" = "." Then
  35.        SelRng = "N/A"
  36.     End If
  37. en:
  38.     Application.EnableEvents = True
  39. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD