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

[µo°Ý] ¨D°ª¤â¸Ñµª¨Ì±ø¥ó¿ë§O¦Û°Ê¿é¤JÀx¦s®æ

[µo°Ý] ¨D°ª¤â¸Ñµª¨Ì±ø¥ó¿ë§O¦Û°Ê¿é¤JÀx¦s®æ

¤p§Ì¬°¨Ïºû­×¸ê®Æ«ØÀɧֳt¡B¥¿½T¡A»Ý¨D¥H¤U²[¼Æ³]­p
       A       B          C         D
1  «O©T  ª÷ÃB  ³ø»ù¤é  ¦P·N¤é
2
3

AÄ榳¤U©Ô¿ï³æ¡A¤À§O¬O¡G«O¤º¡B¤G­×¡B«O¥~¡B¤H¬°
·íA2¿ï¾Ü«O¤ºor¤G­×¡AB2  C2  D2·|¦Û°Ê¶ñ¤W -- ¡A¦]¬°¤£¯à¦³ª÷ÃB¡A¤]¤£·|³ø»ù
·íA2¿ï¾Ü«O¥~or¤H¬°¡AB2¦Û°Ê¶ñ¤W¡¨¶ñª÷ÃB¡¨°µ¬°¦¬¶O´£¿ô¡A
·íB2§ï¶ñ¤W³ø»ùª÷ÃB®É¡AC2¦Û°Ê¶ñ¤WTODAY¤é´Á

ªþ¤WÀɮסA½Ð°ª¤â«üÂI¡A·PÁ¡I

ºû­×³æ.rar (7.03 KB)

robin

ÁÂÁ¤j¤j¦b¦Ê¦£¤¤¦A¦¸«ü¾É,
¦ý¬O³o¸Ì¥Îªº¬OTarget
   ¡i Option Explicit
    Sub Ex()  '°õ¦æ¦¹µ{¦¡·|IJ°Ê Worksheet_SelectionChange(ByVal Target As Range)
        [D5:E6].Select
    End Sub
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)   'Target-> [D56]
        Dim i
        MsgBox Target.Address
        For i = 1 To Target.Count
            MsgBox "Target.Cells(" & i & ") ->" & Target.Cells(i).Address '=> MsgBox Target.(i).Address
        Next
        [B6].Select
    End Sub¡j

¦Ó3¼Ó¥Î¤F Target ¤Î Target(1)

§Ú·Q°Ýªº¬OTarget¬O¤£¬OIJ°Ê Worksheet_SelectionChangeªº¶°¦X(°}¦C),
¦ÓTarget(1)¬O³o¶°¦X(°}¦C)ªº²Ä¤@­Ó¤¸¯À?

¤]´N¬O»¡¦ó®É¥ÎTarget, ¦ó®É¥ÎTarget(1)? ¦³¥i¯àTarget(2)¶Ü?

TOP

¦^´_ 10# GBKEE

¤Ñ°Ú¡I§Ú­ì¨Ó¥H¬°³o¥u»Ý­n¥Î²[¼Æ´N¯à¸Ñ¨M¡A¨S·Q¨ì¬O¥¨¶°¡A§Ú¨S¾Ç¹L¡A
¤£¹L§Ú¸Õ¹L¡A¬O¥i¥H¥Î¡A¥u¬O­ì¨Ó§Æ±æ¿ï«O¤º©Î¤G­×®É¡AB  C  D³£¶ñ¤W--¡A²{¦b¥u¦³B¶ñ¤W
¤Ó¯«©_¤F¡A¥u­n´X¦æ¦r´N¯à·d©w
´N©È§Ú¤£ª¾©Ò¥HµM¡AÀ³¥Î¨ì¨ä¥¦¦a¤è¦³§xÃø

¦ý¬O¡AÀ³¸Ó¹ïÀ´ªº¤H«Ü¦³¥Î¡A¤]¬O¦n¨Æ¡I
robin

TOP

ª©¥D¤j¤j±z¦n¡A¥»¨Ó¥H¬°³o¥Î²[¼Æ´N¥i¥H·d©w¡A§Ú¤£·|¥¨¶°¡A¦ýÁÙ¬O¸ÕµÛ§ï¬Ý¬Ý¡A¼W¥[¤F­ì¨Ó§Æ±æ¡G¦pªG¤U©Ô¿ï«O¤ºor¤G­×¡AB2¡BC2¡BD2³£¦Û°Ê¶ñ¤W--¡A¥H«K°µ¬°¤£¦¬¶O´£¿ô¡A¦ý¬O§ï¹L«á©Ç©Çªº¡A¤U©Ô¿ï«O¥~or¤H¬°¡A¤£·|·Ó­ì¨Óªº³]©w¨º¼Ë¡A½Ð±Ð§Ú

ºû­×³æ.rar (16.02 KB)

robin

TOP

¦^´_ 9# yen956
  1. Option Explicit
  2. Sub Ex()  '°õ¦æ¦¹µ{¦¡·|IJ°Ê Worksheet_SelectionChange(ByVal Target As Range)
  3.     [D5:E6].Select
  4. End Sub
  5. Private Sub Worksheet_SelectionChange(ByVal Target As Range)   'Target-> [D5:D6]
  6.     Dim i
  7.     MsgBox Target.Address
  8.     For i = 1 To Target.Count
  9.         MsgBox "Target.Cells(" & i & ") ->" & Target.Cells(i).Address '=> MsgBox Target.(i).Address
  10.     Next
  11.     [B6].Select
  12. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# GBKEE
                   ¡i '***SelectionChange :¤u§@ªíÀx¦s®æ ¦³²¾°Ê®É©ÒIJµoªºµ{§Ç ****
                    '¦³²¾°Ê¤~¦³Ä²µo½Ð->,¥ý²¾°ÊÀx¦s®æ¦bAÄ椧¥~,¦A²¾°ÊÀx¦s®æ¨ìAÄ椺¬Ý¬Ý¡j
ÁÂÁ¦A¤T»¡©ú, ¦¬¨ì.
¦A¦¸½Ð°Ý¡G
    ¡iPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)¡j
©Ò¥H Worksheet_SelectionChange«á©ÒIJµoªº²Ä¤@­ÓRange´N¬OTarget(1)¬O¤£¬O?

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2014-2-9 19:25 ½s¿è

¦^´_ 1# newlink
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. With Target(1)
  3.   Select Case .Column
  4.   Case 1
  5.   .Offset(, 1).Resize(, 3) = IIf(.Value = "«O¤º" Or .Value = "¤G­×", "--", "¶ñª÷ÃB")
  6.   Case 2
  7.   .Offset(, 1).Resize(, 2) = IIf(IsNumeric(.Value) And .Value <> "", Date, "")
  8.   End Select
  9. End With
  10. End Sub

  11. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  12. If Target(1).Column = 1 Then '¿ï¨úAÄæ
  13. With Target(1).Validation '³]©wÅçÃÒ²M³æ
  14.   .Delete
  15.    .Add xlValidateList, , , "«O¤º,¤G­×,«O¥~,¤H¬°"
  16. End With
  17. End If
  18. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 5# GBKEE
¸U¤À©êºp£®, ­è­è¤S¸Õ¤F¤@¤U, ¤w¸g¯à·Ó§Aªº³]­p°õ¦æ, ¸U¤À·PÁÂ,
(³Ìªñ¹q¸£©Ç©Çªº, ­è­è¤~­«·sÁÙ­ì, ¹ê¦b©êºp)

TOP

¦^´_ 5# GBKEE
·PÁÂGBKEE¤j¤jªº¦^ÂÐ,
¦ý¬O§Ú´N¬O¶K¦b sheet1 ªºµ{¦¡°Ï, ¦ý¤£ºÞ¥Î, ¤£ª¾­þ¸Ì¦³°ÝÃD.
(§Ú¥u¬O»¡¼Ò²Õ¤]¸Õ¹L)
Àɮצp¤W:

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-9 18:34 ½s¿è

¦^´_ 4# yen956
¤£­n¶K¦b¤@¯ë¼Ò²Õ
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.                 '***SelectionChange :¤u§@ªíÀx¦s®æ ¦³²¾°Ê®É©ÒIJµoªºµ{§Ç ****
  3.                 '¦³²¾°Ê¤~¦³Ä²µo½Ð->,¥ý²¾°ÊÀx¦s®æ¦bAÄ椧¥~,¦A²¾°ÊÀx¦s®æ¨ìAÄ椺¬Ý¬Ý
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : µoµÊ®ð¬Oµu¼ÈªºµoºÆ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD