The following is code I am using to start a user form macro that will start a dialog box asking the user if they've received approval to exceed a specified threshold:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim answer As String
If Not Intersect(Target, Sheet8.Range("I5:U5")) Is Nothing Then
If Target.Value > Sheet15.Range("threshold") Then
formAsk.Show
answer = formAsk.TextboxWhom
If Sheet15.Range("therightname").Find(what:=answer) Is Nothing Then ' modified
MsgBox "Please contact RP ALARA for dose approval."
End If
On Error GoTo BackupFile
Open ThisWorkbook.Path & "\responselog.txt" For Append Access Write Lock Write As #2
On Error GoTo 0
Dim ThisUser As String
'thisuser = Application.username ' registration in MS Office
ThisUser = Environ("USERNAME") ' Windows login
Print #2, Now & " User: " & ThisUser & " Response: " & answer
Close 2
End If
End If
Exit Sub
BackupFile:
Open ThisWorkbook.Path & "\responselog2.txt" For Append Access Write Lock Write As #2
Print #2, Now & " User: " & ThisUser & " Response: " & answer
Close 2
End Sub
However, I can't get it to work right b/c when I change a cell value in the range I5:U5, the macro does not run (see the bolded portion in the code). I know this code works b/c I submitted a dummy workbook months ago and the code works for the dummy workbook, but when I tried to modify the code to match the actual workbook I am using, I couldn't get it to work right. Furthermore, the range I am working with is not a continous range and I want to make sure I input the right syntax for non-contiguous range as well. Any help would be greatly appreciated
Thanks.
HP RodNuclear
Bookmarks