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

[µo°Ý] ¸Ó¦p¦ó¿é¤J§¹¸ê®Æ«á,¦Û°Ê©¹¤U¤@Àx¦s®æÄ~Äò¿é¤J¸ê®Æ

¦^´_ 1# yueh0720
¸Ó¤u§@ªíÀx¦s®æ¦³¿é¤J®Éªº¹w³]¨Æ¥ó
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.     Dim Rng As Range, R1%, R2%
  3.     Set Rng = Range("B2").CurrentRegion
  4.     'CurrentRegion¥H¥ô·NªÅ¥Õ¦C¤ÎªÅ¥ÕÄ檺²Õ¦X¬°Ãä¬Éªº³sÄò½d³ò
  5.     If Not Application.Intersect(Target(1), Rng) Is Nothing Then   'Rngªº½d³ò¥]§tTarget(1)ªº¦ì§}
  6.     'Target(1) ->¤u§@ªí©Ò¿ï¾Ü½d³òªº²Ä¤@­ÓÀx¦s®æ
  7.         If Target(1).Row = Rng.Row Then Exit Sub    ' ¦b²Ä¤@¦C
  8.         R1 = Rng.Column                             '²Ä¤@Ä檺   Äæ¼Æ
  9.         R2 = Rng(1, Rng.Columns.Count).Column       '³Ì«á¤@Ä檺 Äæ¼Æ
  10.         If Application.CountA(Range(Cells(Target(1).Row, R1), Cells(Target(1).Row, R2))) = Rng.Columns.Count Then
  11.             '¦³¸ê®Æ¼ÆªºÀx¦s®æ=RngªºÁ`Äæ¼Æ
  12.             Cells(Target(1).Row + 1, R1).Select  '¿ï¾Ü¤U¤@¦Cªº²Ä1Äæ
  13.         End If
  14.        End If
  15. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD