Frncis
Member
I have code that is calls a message & opens a folder in another location when "No" is entered in range "H4:H10, H13:H17". However when No is entered in range "J4:R17" the code runs again. What is the best way to preventing the code from running outside of H4:H10, H13:H17".
I tried
& was told that the variable is already in use. I understand why, but don't know how to overcome the earlier stated problem.
Code:
Option Explicit
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'The code below is a reminder to enter data in the Referral Workbook.
Application.ScreenUpdating = False
Dim lastRow As Long
Dim Cell As Range
lastRow = Range("H" & Rows.Count).End(xlUp).Row
Dim Chk As Boolean
For Each Cell In Range("H4:H10, H13:H17")
If LCase(Cell.Value) = "no" Then
If Target.Value = "No" And Target.Offset(, 15).Value = True Then
MsgBox "Check to verify veteran data is entered in FY ## REFERALS." & vbCr & _
"It's critical that the veteran data is captured." & vbCr & _
"You have entered No into cell" & Target.Address, , vbInformation, "Vocational Services - Career Link " & ActiveSheet.Name
Chk = True
Exit For
End If
End If
Next
If Target.Value = "No" Then Call Referals
Application.ScreenUpdating = True
End Sub
Code:
For Each Cell In Range("H4:H10, H13:H17")
If LCase(Cell.Value) = "no" Then