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

½Ð±Ð¨â­ÓWorksheet_Change¨Æ¥ó¶¡¤¬¤£¤zÂZªº°µªk

½Ð±Ð¨â­ÓWorksheet_Change¨Æ¥ó¶¡¤¬¤£¤zÂZªº°µªk

§Ú¦bsheet1»Psheet2§¡¦³¨Ï¥ÎPrivate Sub Worksheet_Change(ByVal Target As Range)¨Æ¥ó
§Ú·Q­nªº¥Øªº¬O¤£½×¦b­þ¤@±i¤u§@ªíªºA2Àx¦s®æ¿é¤J1~100¤§¶¡ªº¥N¸¹³£­n¤¬¬Û¶Ç­Èµ¹¹ï¤è¬Û¦P¦ì¸mÅã¥Ü¥i¬O¤S¤£­n¥hIJÀ»¥t¤@­Ó¨Æ¥ó¡A¦ý¬O¥Ø«eªº¼gªk·|³y¦¨µL½a°j¸ô¡A½Ð°Ý­n¦p¦ó°µ¤~¦æ?
text.rar (14.76 KB)

¦^´_ 1# yuch8663
§A­ì¥»ªºApplication.EnableEvents  ¨S¦³.
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. '   Application.ScreenUpdating = False  '°±¤î §ó·sSheet®É µe­±¡A¥[³t¹Bºâ
  3. '   Application.DisplayAlerts = False  '°±¤î §R°£Sheet®É ¹w³]ªºÄµ§i
  4.     If Target.Address <> "$A$2" Then Exit Sub
  5.     Application.EnableEvents = False  '°±¤î¨Æ¥ó  '
  6.      Columns("d:d").ClearContents
  7.     For i = 1 To 100
  8.         If Sheets("sheet1").Range("a2").Value = Val(Sheets("sheet3").Cells(i, 1).Value) Then
  9.            Sheets("sheet1").Range("b2").Value = Sheets("sheet3").Cells(i, 2).Value
  10.            Sheets("sheet2").Range("a2").Value = Sheets("sheet1").Range("a2").Value
  11.            Sheets("sheet2").Range("b2").Value = Sheets("sheet1").Range("b2").Value
  12.         End If
  13.     Next
  14.     Call aaa
  15.     Application.EnableEvents = True  '«ì´_°±¤î¨Æ¥ó     '²¾¨ì³o¸Ì
  16. '   Application.ScreenUpdating = True  '°±¤î §ó·sSheet®É µe­±¡A¥[³t¹Bºâ
  17. '   Application.DisplayAlerts = True  '°±¤î §R°£Sheet®É ¹w³]ªºÄµ§i
  18. End Sub
½Æ»s¥N½X

TOP

ÁÂÁÂGBKEEª©¥D«ü¾É¡A¤w¸g¥i¥H¥Î¤F¡C

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD