mloucel
New Member
- Joined
- Feb 22, 2016
- Messages
- 37
I need to check ONLY a certain range of columns to be empty and display a message to the End user so he can correct the problem
this is the code I have so far, it works but not the way I want..
PROBLEM:
Not only checks for the specific Columns but for the WHOLE Row the user is at that moment, so if there are empty cells after P the message displays again, which is not what I want, I'm fairly new and I have tried some other things to no avail.. I know my logic is somewhat correct but I just don't know enough code to figure out what instruction should I use to get my objective.
Please Gurus can you lend a hand..
Thanks.
this is the code I have so far, it works but not the way I want..
Code:
Set TestInRange = Intersect(Target, Range("F2:F1500, G2:G1500, H2:H1500, I2:I1500, I2:I1500, J2:J1500, K2:K1500, L2:L1500, M2:M1500, N2:N1500, O2:O1500, P2:P1500"))
If Len(Cells(Target.Row, "R")) <> 0 Then ' IF the user is in R is R empty or does it have Data ?
If TestInRange Is Nothing Then ' IF R has Data then, is there any cell in my TestInRange that is empty ?
WhereIAm = Target.Row
MsgBox "THERE ARE IMPORTANT CELLS LEFT EMPTY " & vbCrLf & "" _
& vbCrLf & "YOU MUST Fill these cells:" _
& vbCrLf & "" _
& vbCrLf & "Patient Last or First Name,DOB, Chart Number, Phone Number," _
& vbCrLf & "IPA, Health Plan, Diagnosis, Referred to or Referral by Doctor," _
& vbCrLf & "(ONE OR MORE THAN ONE) is/are Empty." _
& vbCrLf & " " _
& vbCrLf & "Please go back and re-enter the values...", _
vbCritical, "Validation NOT PASSED..."
' Forcing the User to go to DATE CELL
ActiveCell.Offset(-1, -12).Select
'
End If
End If
PROBLEM:
Not only checks for the specific Columns but for the WHOLE Row the user is at that moment, so if there are empty cells after P the message displays again, which is not what I want, I'm fairly new and I have tried some other things to no avail.. I know my logic is somewhat correct but I just don't know enough code to figure out what instruction should I use to get my objective.
Please Gurus can you lend a hand..
Thanks.