Message Box and Return to Required Cell

ruthverkuyl

New Member
Joined
May 19, 2009
Messages
1
I am trying to force a user response to a cell, when the user leaves the cell blank and tries to navigate to another sheet, the message box would remind them of required entry and return to the sheet and cell.

I have set up on deactivate sheet to run message box when cells are false which works, but I can't seem to get it right to return to the sheet. It flashes the tab that it is activating but it is in a loop and I have to force quit.
Thank you for any assistance
Ruth


Private Sub Worksheet_Deactivate()
If Range("E69").Value = False Then
If Range("F69").Value = False Then

MsgBox "Required to answer meets competency requirements YES or NO.", vbOKCancel

Sheets("Scoring").Activate
Range("E69").Select
End If

End If
End Sub
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hello and welcome to The Board.
I don't have a solution for you but I can tell you that the code you gave does work for me when I enter it into a new workbook.
Do you have any other VBA code in the workbook that could be responsible for the problem?
 
Upvote 0
Something like this might be a smoother user interface.
In worksheet Scoring's code module
Code:
Private Sub Worksheet_Deactivate()
If Range("E69").Value = False Then
    If Range("F69").Value = False Then
        With Sheets("Scoring").Range("E69")
            Select Case MsgBox("Does this person meet Comptency", vbYesNoCancel)
                Case Is = vbYes
                    .Value = "YES"
                Case Is = vbNo
                    .Value = "NO"
                Case Else
                    .Parent.Activate
            End Select
        End With
    End If
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top