Hi Greg,
This is what I want, that one cannot leave SHEET1 unless the error input is corrected. Perfect! BUT;
As said,there are about 40 MsgBox codes entered;
So, for all 40 such codes I have to enter ".Activate" after the IF line. Actually took 5 codes, pasted under "Private Sub Worksheet_Deactivate()" tested by placing 5 such ".Active" codes and works perfectly. But the issue is each and every time I create a code and place it under my usual code "Private Sub Worksheet_Change(ByVal Target As Range)", I also have to create a duplicate and paste it under "Private Sub Worksheet_Deactivate()" because "Private Sub Worksheet_Change(ByVal Target As Range)" shows the MsgBox immediately where one can correct the mistake on the spot whilst "Private Sub Worksheet_Deactivate()" shows the MsgBox only when exiting the SHEET1.
What I acuallyy need is for the MsgBox to pop-up immediately if a wrong item is pressed or selected so that one can correct it immediately (Private Sub Worksheet_Change(ByVal Target As Range)) and I also need a separate code such as yours (Private Sub Worksheet_Deactivate()) to check in general if any such MsgBox in "Private Sub Worksheet_Change(ByVal Target As Range)" are triggered before exiting the SHEET1.
Thanks again Greg!
Best wishes
Rizvi
Bookmarks