jski21
Board Regular
- Joined
- Jan 2, 2019
- Messages
- 155
- Office Version
- 2016
- Platform
- Windows
Trying to get an input box to pop up so a user can enter abrief comment that will then appear in a comment attached to the cell. Theproblem I believe I’m running into is the user inputs data into a table on onesheet which feeds results over to another sheet; Sheet X. It is the results in SheetX’s range where I’d like the comments to reside. I think I need to specifySheet X in the range below to get this to work?
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'`````````````````````````````````````````````````````'
'Create pop up input box and add comment if"<=98.9%" result'
Dim sReason AsString
If NotIntersect(Target,Range("$B$26:$B$28,$B$30:$B$32,$B$34:$B$36,$B$38:$B$40,$E$26:$E$28,$E$30:$E$32,"& _
"$E$34:$E$36,$E$38:$E$40,$J$26:$J$28,$J$30:$J$32,$J$34:$J$36,$J$38:$J$40,"& _
"$M$26:$M$28,$M$30:$M$32,$M$34:$M$36,$M$38:$M$40")) Is NothingThen
IfTarget.Value > 0 <= 0.989 Then
sReason =Application.InputBox("Please provide a brief comment on why KPI wasmissed", Type:=2)
Target.AddComment
Target.Comment.Visible = False
Target.Comment.Text Text:=sReason
End If
End If
Application.ScreenUpdating = True
End Sub
Thanks
jski
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'`````````````````````````````````````````````````````'
'Create pop up input box and add comment if"<=98.9%" result'
Dim sReason AsString
If NotIntersect(Target,Range("$B$26:$B$28,$B$30:$B$32,$B$34:$B$36,$B$38:$B$40,$E$26:$E$28,$E$30:$E$32,"& _
"$E$34:$E$36,$E$38:$E$40,$J$26:$J$28,$J$30:$J$32,$J$34:$J$36,$J$38:$J$40,"& _
"$M$26:$M$28,$M$30:$M$32,$M$34:$M$36,$M$38:$M$40")) Is NothingThen
IfTarget.Value > 0 <= 0.989 Then
sReason =Application.InputBox("Please provide a brief comment on why KPI wasmissed", Type:=2)
Target.AddComment
Target.Comment.Visible = False
Target.Comment.Text Text:=sReason
End If
End If
Application.ScreenUpdating = True
End Sub
Thanks
jski