- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 3# yueh0720
¸Õ¸Õ¬Ý- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim Rng As Range, R1%, R2%
- Set Rng = Range("B2").CurrentRegion
- 'CurrentRegion¥H¥ô·NªÅ¥Õ¦C¤ÎªÅ¥ÕÄ檺²Õ¦X¬°Ãä¬Éªº³sÄò½d³ò
- If Not Application.Intersect(Target(1), Rng) Is Nothing Then 'Rngªº½d³ò¥]§tTarget(1)ªº¦ì§}
- 'Target(1) ->¤u§@ªí©Ò¿ï¾Ü½d³òªº²Ä¤@ÓÀx¦s®æ
- If Target(1).Row = Rng.Row Then Exit Sub ' ¦b²Ä¤@¦C
- R1 = Rng.Column '²Ä¤@Ä檺 Äæ¼Æ
- R2 = Rng(1, Rng.Columns.Count).Column '³Ì«á¤@Ä檺 Äæ¼Æ
- If Application.CountA(Range(Cells(Target(1).Row, R1), Cells(Target(1).Row, R2))) = Rng.Columns.Count Then
- '¦³¸ê®Æ¼ÆªºÀx¦s®æ=RngªºÁ`Äæ¼Æ
- Cells(Target(1).Row + 1, R1).Select '¿ï¾Ü¤U¤@¦Cªº²Ä1Äæ
- Else '¦³¸ê®Æ¼ÆªºÀx¦s®æ<>RngªºÁ`Äæ¼Æ
- If Target(1) <> "" Then
- R2 = IIf(Target(1).Column = R2, R1, Target(1).Column + 1)
- '¦p¬°³Ì«á¤@Ä檺 ªð¦^²Ä1Äæ §_©¹¥k¤@Äæ
- Cells(Target(1).Row, R2).Select '©¹¥k¤@Äæ
- End If
- End If
- End If
- End Sub
½Æ»s¥N½X |
|