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

[µo°Ý] Worksheet_SelectionChangeªº°ÝÃD

[µo°Ý] Worksheet_SelectionChangeªº°ÝÃD

¤U¦CVBA
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.     MsgBox Target.Address
  3. End Sub
½Æ»s¥N½X
·í´å¼Ð±q B2 ²¾¨ì D4 ®É, ·|§e²{ $D$4 ªº°T®§,
½Ð°Ý½Ñ¦ì¤j¤j, ¦pªG­nÅý¥¦§e²{ $B$2 ªº°T®§,
VBA ­n¦p¦ó§ï? ·P®¦!!

¦^´_ 1# yen956
¥u­n¬O·í´å¼Ð±qB2²¾¨ì,¨ä¥L¥ô¤@Àx¦s®æ®É, ·|§e²{B2ªº°T®§,
¬O³o¼Ë¶Ü?
  1. Option Explicit
  2. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  3.     Static t As Range
  4.     If Not t Is Nothing Then
  5.         If t.Address(0, 0) = "B2" Then MsgBox [B2]
  6.     End If
  7.     Set t = Target
  8. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE
ÁÂÁ¦^ÂÐ:
©êºp¨S»¡²M·¡, §Ú§Æ±æ:
·í´å¼Ð±q B2 ²¾¨ì D4 ®É, ·|§e²{ $B$2 ªº°T®§,
·í´å¼Ð±q D4 ²¾¨ì C5 ®É, ·|§e²{ $D$4 ªº°T®§,
§Y, ·|¥X²{´å¼Ð²¾°Êªº«e¤@®æªº¦ì¸m°T®§

TOP

¦^´_ 3# yen956
  1. Public BeforeCell As Range
  2. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  3. If BeforeCell Is Nothing Then Set BeforeCell = ActiveCell
  4. If BeforeCell.Address <> Target.Address Then MsgBox BeforeCell.Address & Chr(10) & BeforeCell(1)
  5. Set BeforeCell = Target(1)
  6. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# Hsieh
·PÁ¶Wª©ªº¦^ÂÐ,
«Ü¦X»Ý¨D, ÁÂÁÂ!!

TOP

        ÀR«ä¦Û¦b : ½_ÁJµ²±o¶V¹¡º¡¡A¶V·|©¹¤U««¡A¤@­Ó¤H¶V¦³¦¨´N¡A´N­n¶V¦³Á¾¨Rªº¯ÝÃÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD