- Joined
- Dec 13, 2017
- Messages
- 71
- Reaction score
- 19
The difference between the working code & the new code is the cell range. In the working cell the Range is B4:B17, & B:B. Here is the working code:
The new code Range is J4:J17 & J:J. The message does change, but I am more concerned about this line :
What changes can I make to that line? Some other lines do use Dim, but it should not matter. If it does I will provide the lines.
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'Reminds the user to enter the carryover name into the current FY listing.
Dim MsgBoxResult As Long
If Target.Count > 1 Then Exit Sub
If Intersect(Target, Range("B4:B17")) Is Nothing Then Exit Sub
MsgBoxResult = MsgBox("Is this a follow up? " & vbCr, _
vbYesNo, "Vocational Services - OVR " & ActiveSheet.Name)
If MsgBoxResult = vbYes Then
Exit Sub
ElseIf MsgBoxResult = vbNo Then
MsgBoxResult = MsgBox(" It's critical that Carryover data is captured! " & vbCr, _
vbInformation, "Vocational Services - OVR " & ActiveSheet.Name)
If WorksheetFunction.CountA(Range("B:B")) <> 0 Then
MsgBox " Check to verify Veteran data is entered in FY ## Referrals" & vbCr & _
" It's critical that Carryover data is captured. " & vbCr & _
"" & vbCr & _
" Please enter the name in walk in list if not on either last " & vbCr & _
" year's or this year's consult list! " & vbCr & _
"" & vbCr & _
" Enter veteran as a walk in, if there was a consult from last year and " & vbCr & _
" enter the SC percent" & vbCr & _
"" & vbCr & _
" You have entered " & Cells(Target.Row, 2) & " in cell " & Target.Address, vbInformation, "Vocational Services - OVR" & ActiveSheet.Name
Call Referals 'Calls Referrals folder.
Else
Exit Sub
End If
End If
End Sub
The new code Range is J4:J17 & J:J. The message does change, but I am more concerned about this line :
Dim MsgBoxResult As Long
.What changes can I make to that line? Some other lines do use Dim, but it should not matter. If it does I will provide the lines.