Hey all,
i have a question. I am currently using this code below to make a specified range "needfill" as a setion of a work sheet that needs to be filled out to completion. i want to do the same thing for another set of ranges "IFYES" "IFNO" i want the range set "IFYES" to be required the same as the code below if a box is checked YES. i also want to require another range "IFNO" if the box is checked NO. not sure how to make this one cell $A$28 that has a dropdown list(YES or NO) the deciding value. :confused2:
any help would be greatly appreciated.
Thanks, all. :becky:
i have a question. I am currently using this code below to make a specified range "needfill" as a setion of a work sheet that needs to be filled out to completion. i want to do the same thing for another set of ranges "IFYES" "IFNO" i want the range set "IFYES" to be required the same as the code below if a box is checked YES. i also want to require another range "IFNO" if the box is checked NO. not sure how to make this one cell $A$28 that has a dropdown list(YES or NO) the deciding value. :confused2:
any help would be greatly appreciated.
Thanks, all. :becky:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rNextCell As Range, bMsg As Boolean
If Not Intersect(Target, Me.Range("needfill")) Is Nothing Then
Exit Sub
End If
If WorksheetFunction.CountA(Me.Range("needfill")) <> Me.Range("needfill").Cells.Count Then
bMsg = False
For Each rNextCell In Me.Range("needfill").Cells
If Len(rNextCell.Value) = 0 Then
Application.EnableEvents = False
rNextCell.Select
Application.EnableEvents = True
bMsg = True
Exit For
End If
Next rNextCell
If bMsg = True Then
MsgBox "Please fill in required cells before continuing!", vbInformation, "ERROR!"
End If
End If
End Sub