返回列表 上一主題 發帖

[發問] 關於資料驗證問題

本帖最後由 Hsieh 於 2014-8-28 22:21 編輯

回復 5# j88141
驗證公式改一下
=COUNTIF($G$2:$H$5,A$2)>0
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. If Intersect(Target, [A1:C1]) Is Nothing Then Exit Sub '輸入人名的範圍設定在A1:C1
  3. If Target.Count > 1 Then MsgBox "只能改變一格": Exit Sub
  4.         Set Rng = Range("C:C").Find(Target, LookAt:=xlWhole, MatchCase:=True)
  5.         With Target.Offset(1)
  6.             If Not Rng Is Nothing Then .Value = Rng.Offset(0, 1).Value: Application.SendKeys "{F2}~"
  7.             DoEvents
  8.            If .Validation.Value = False Then .Value = ""
  9.         End With
  10. End Sub
複製代碼
活頁簿.rar (14.43 KB)
學海無涯_不恥下問

TOP

        靜思自在 : 修行要繫緣修心,藉事練心,隨處養心。
返回列表 上一主題