✔ 最佳答案
內建係有此功能. 不過, 呢個公能會唔會發動就請看以下.
1) 直接係B1 打 "=A1"
2) 直接係B2 打 "=A2"
3) 直接係B3 打 "=A3"
4) 直接係B4 打 "=A4"
5) 直接係B5 打 "=A5"
6) 係A5打入任何資料
7) 係A1至A4其中2格打入任何資料, [最少輸入一半以上的格]
之後, 由依定開始, A欄 資料底端既格仔下面個格打野佢會自己JUMP出黎
再唔係就按Alt + F11 用vba做. 要求Excel版本 要係Home 以上
1) Alt + F11
2) 按Ctrl + R 出現[專案總管]
3) [專案總管] 裹面搵你個Excel Worksheet既名, Double Click佢.
4) Double Click 會有個白色打字既Window走左出黎.
5) Copy以下Paste落去 改番個 "F1" 同 "A2"
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
From_Data_Head = "F1"
To_Data_Head = "A2"
TmpAX = Range(From_Data_Head).Row
TmpAY = Range(From_Data_Head).Column
TmpBX = Range(To_Data_Head).Row
TmpBY = Range(To_Data_Head).Column
Mrl_System_End = Cells.EntireRow.Count
TmpEnd = Cells(Mrl_System_End, TmpAY).End(xlUp).Row - TmpAX + 1
If Not (Cells(Mrl_System_End, TmpAY).Value = "") Then TmpEnd = Mrl_System_End
TmpB = ""
MsgBox TmpBX + TmpEnd
If (TmpBX + TmpEnd) > Mrl_System_End Then
TmpB = TmpB & "Not enought row from the column of" & To_Data_Head & Chr(10)
TmpB = TmpB & "Data-Copy stops at "
TmpD = TmpEnd - ((TmpBX + TmpEnd) - Mrl_System_End)
TmpB = TmpB & Cells(TmpD + 1, TmpAY).Address
TmpEnd = TmpEnd - ((TmpBX + TmpEnd) - Mrl_System_End) + 1
End If
MsgBox TmpEnd
For n = TmpAX To TmpEnd
TmpC = Not (Cells(TmpBX + (n - TmpAX), TmpBY).Value = Cells(n, TmpAY).Value)
If TmpC Then Cells(TmpBX + (n - TmpAX), TmpBY).Value = Cells(n, TmpAY).Value
Next
MsgBox TmpB
If Not (TmpB = "") Then MsgBox TmpB
Application.EnableEvents = True
End Sub
2012-10-22 20:32:54 補充:
打錯左D野. 呢個唔會係咁彈Message Box
Msgbox 開頭既Row 要Delete左佢. 有3句
1) MsgBox TmpBX + TmpEnd
2) MsgBox TmpEnd
3) MsgBox TmpB
2012-10-22 21:25:36 補充:
你問個vba 定係個Excel 內建function?
我個人唔建議用Excel內建個Function. 因為還不算人性化.
個VBA係可以係第2,及3行改成你想要的格仔
個VBA既界限就係個Excel既界限, G欄以外都可以做到.