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

[µo°Ý] ½Ð¦U¦ì¥ý¶i«ü¾É¤£ª¾¿ù¦b¨º

[µo°Ý] ½Ð¦U¦ì¥ý¶i«ü¾É¤£ª¾¿ù¦b¨º

¤j®a¦n,§Ú¼g¤U¤@­Ó¨Æ¥ó¦p¤U:
¬O·Q±N¦b¿é¤J²Ä¥|©Î²Ä¤»­ÓÀx¦s®æ®É·|¦Û°ÊÅÜ°£¥H10000«á¦AÂন¾ã¼Æ
¦ý¹ê»Ú¹B§@¿é¤J¼Æ¦r®É³oµ{¦¡§¹¥þ¨S¤ÏÀ³§Ú¸Õ¤F¥ÎMsgBox("Hello!")¦ý
¤]¨S¥X²{¥i¨£®Ú¥»¨S©I¥s¤U¦Cµ{¦¡¤£ª¾¿ù¦b¨º...½Ð«ü¾É
Private Sub Worksheet_Change(ByVal Target As Range)
'MsgBox("Hello!")
With Target
     If Target.Column = 4 Or Target.Column = 6 Then
        ActiveCell.Value = Round(ActiveCell.Value / 10000)
     End If
End With
End Sub

¥»©«³Ì«á¥Ñ luhpro ©ó 2013-10-17 23:45 ½s¿è
¤j®a¦n,§Ú¼g¤U¤@­Ó¨Æ¥ó¦p¤U:
¬O·Q±N¦b¿é¤J²Ä¥|©Î²Ä¤»­ÓÀx¦s®æ®É·|¦Û°ÊÅÜ°£¥H10000«á¦AÂন¾ã¼Æ
¦ý¹ê»Ú¹B§@ ...
maomao µoªí©ó 2013-10-17 21:16

1. ¦]¬° ActiveCell »P Target ¤£¬O¦P¤@­ÓÀx¦s®æ,

·í§A«ö¤U Enter ®É ActiveCell ¤w¸g²¾¦ì¤F.

2. ¬JµM§A«e­±¤w¸g¥Î¤F With Target,

¨º»ò¦b End With ¤§«e¥u­n¦³°Ñ·Ó¨ì Target ªº«ü¥O³£¥i¥H¥Î . ¨Ó¨ú¥N¨Ï¥Î.

3. ¦]¬°ÅܧóÀx¦s®æ¤º®e®É(¥]§t¥Ñ Excel VBA µ{¦¡Åܧóªº)³£·|©I¥s Worksheet_Change,

¬G¦ÓÀ³¦bÅܧó«e±NIJµo¶}Ãö (Application.EnableEvents) Ãö±¼,

¦A©óÅܧó«á¥´¶},

¥HÁקK¥X²{ ¤£¥i¹w´Áªº¿ù»~µ²ªG ¬Æ¦Ü¬O "µL­­¦¸ªº" IJµo(©I¥sµ{¦¡)ªº¿ù»~¥X²{.

­×§ï«áªºµ{¦¡¦p¤U :
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.   With Target
  3.     If .Column = 4 Or .Column = 6 Then
  4. Application.EnableEvents = False
  5.       .Value = Round(.Value / 10000)
  6. Application.EnableEvents = True
  7.     End If
  8.   End With
  9. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¥ÌÄ@°µ¡BÅw³ß¨ü¡C
ªð¦^¦Cªí ¤W¤@¥DÃD