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

[µo°Ý] ·Q¤£©ú¥Õ¬°¦óµ{¦¡·|¶i¤JµL½u°j°é

[µo°Ý] ·Q¤£©ú¥Õ¬°¦óµ{¦¡·|¶i¤JµL½u°j°é

§Ú¬OVBA·s¤â,¦b½m²ß¥H¤Uµ{¦¡,·|¶i¤JLOOP¸õ¤£¥X¨Ó
­ì¥»¥Î·N¬O¦bÄæV¦ì¿é¤J¸ê®Æ(IJµoµ{§Ç)«á·|¦bD1:E10½d³ò¤º§ä¬Û¦P¸ê®Æ«á,¿é¥X¦Ü¬Û¹ïªºÄæ¦ìB
¥Î¤@¯ëªº Sub () ¥i¦æ,§ï¥Î Sub Worksheet_Change(ByVal Target As Range)´N·|¶i¤JµL­­¦^°é¤¤

Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Variant
Dim I As Integer
  X = Range("A" & Rows.Count).End(xlUp).Row
    For I = 1 To X
      Cells(I, 2) = Application.VLookup(Cells(I, 1), Range("D1:E10"), 2)
    Next I
End Sub

½Ð¤j®a«üÂI....ÁÂÁÂ

¥»©«³Ì«á¥Ñ lpk187 ©ó 2015-12-8 17:57 ½s¿è

¦^´_ 1# morris_lth


    Worksheet_Change¬OÅܧó¤u§@ªí¤¤ªºÀx¦s®æ®É·|µo¥Í¦¹¨Æ¥ó
¦ÓCells(I, 2) = Application.VLookup(Cells(I, 1), Range("D1:E10"), 2)¦Ó¥¿¬O°µÅܧ󪺰ʧ@¡A·íµM·|¶i¤JµL½u°j°é¤J¤¤
©Ò¥H¥²¶·­n¦b³o¦C¤§«e¼gApplication.EnableEvents = False ¨Ó¸T¤î°µÄ²µo°Ê§@
¤§«á¼gApplication.EnableEvents = True ¨Ó­«·s±Ò°ÊIJµo°Ê§@

Application.EnableEvents = False
For I = 1 To X
      Cells(I, 2) = Application.VLookup(Cells(I, 1), Range("D1:E10"), 2)
Next I
Application.EnableEvents = True

TOP

¦ÒÃD¨Ó¤F !!

¥¿±`¤UÀ³¸Ó¦p(1) ¤@¼Ë³´¤JµL½a¦^°é
¦³¨S¦³¤Hª¾¹D¬°¦ó (2) «o¤£·|³´¤JµL½a¦^°é

(1)
Private Sub Worksheet_Change(ByVal Target As Range)
  For w = 1 To 2
  [A1] = Val([A1]) + 1
  Next
End Sub

(2)
Private Sub Worksheet_Change(ByVal Target As Range)
  For w = 1 To 1
  [A1] = Val([A1]) + 1
  Next
End Sub

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2015-12-9 08:35 ½s¿è

¦^´_ 1# morris_lth
¦]¬°§A¨Ã¨S¦³§i¶D¨t²Î¦b¬Æ»òÄæ¦ì¦³¥ô¦ó²§°Ê®É¡A¤~¥h³B²zIJµo¨Æ¥ó¡C
¥ç§Y§A¨S«ü©w Target ¬O¬Æ»ò¡H ¥ô¦óÄæ¦ì¡H ¥ç©Î¬O¬Y­Ó¯S©wÄæ¦ì¡H
¦p A Äæ¦ì.......¡H ©Ò¥H¤~·|·Pı¬O¦b¤£Â_¦aµL½a°j°é¡C
¦]¬°§A¥Ø«eµ{¦¡ùØ©Ò¤Uªº±ø¥ó¬O¡G
"¥u­nªí³æ¤º¦³¥ô¦ó²§°Ê®É¡AÀH§Y³B²zIJµo¨Æ¥ó"¡C

TOP

¦]¬°§Aªºµ{¦¡¦b³æ¤¸®æ³Q­×§ïªº¹Lµ{¤¤­×§ï¤F³æ¤¸®æªº¤º®e¡A¾É­P¤G¦¸¨Æ¥ó¿E¬¡¡K¡K
¥i¥H°µ¦p¤U­×§ï¡]¼W¥[¨â¦æ¥N½X¡^¡G
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.   Dim X As Variant
  3.   Dim I As Integer
  4.   
  5.   Application.EnableEvents = False
  6.   X = Range("A" & Rows.Count).End(xlUp).Row
  7.   For I = 1 To X
  8.     Cells(I, 2) = Application.VLookup(Cells(I, 1), Range("D1:E10"), 2)
  9.   Next I
  10.   Application.EnableEvents = True
  11. End Sub
½Æ»s¥N½X
¥@¬É¨º»ò¤j¡A¥i§Ú·Q¥h­þ¡H

TOP

­ì¨Ó¬O³o¼Ëªü~
ÁÂÁ¤j®aªº»¡©ú...

TOP

        ÀR«ä¦Û¦b : ¯àµ½¥Î®É¶¡ªº¤H¡A¥²¯à´x´¤¦Û¤v§V¤Oªº¤è¦V¡C
ªð¦^¦Cªí ¤W¤@¥DÃD