1
下面的代碼有問題。它正確地顯示了輸入框,當用戶輸入範圍J1:J503
中的值9或10時,但輸入框輸出沒有按照我的意圖顯示在列L中。爲什麼?輸入框文本不在單元格中顯示
Private Sub Worksheet_Change(ByVal Target As Range)
Dim vrange As Range, cell As Range
Dim TheAnswer$
Set vrange = Range("J1:J503")
If Intersect(vrange, Target) Is Nothing Then Exit Sub
For Each cell In Intersect(vrange, Target)
If cell.Value = 9 Or cell.Value = 10 Then
Target.Offset(0, 2).Select
TheAnswer = InputBox("Please put comments", "Comments required for option 9 and 10")
End If
Next cell
End Sub
這是完美的。非常感謝 – SpoonTea