- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
本帖最後由 Hsieh 於 2014-8-28 22:21 編輯
回復 5# j88141
驗證公式改一下
=COUNTIF($G$2:$H$5,A$2)>0- Private Sub Worksheet_Change(ByVal Target As Range)
- If Intersect(Target, [A1:C1]) Is Nothing Then Exit Sub '輸入人名的範圍設定在A1:C1
- If Target.Count > 1 Then MsgBox "只能改變一格": Exit Sub
- Set Rng = Range("C:C").Find(Target, LookAt:=xlWhole, MatchCase:=True)
- With Target.Offset(1)
- If Not Rng Is Nothing Then .Value = Rng.Offset(0, 1).Value: Application.SendKeys "{F2}~"
- DoEvents
- If .Validation.Value = False Then .Value = ""
- End With
- End Sub
複製代碼
活頁簿.rar (14.43 KB)
|
|