gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I want to run a check before the user leaves the tab.
I want it to run when the user leaves the tab, but I am assuming "Deactivate" isn't what I think it is because its not working when I leave the tab. The code works if I run it. Is there a way to run this when they leave the tab?
Code:
Private Sub Worksheet_Deactivate()
'
Range("D1").Select
ActiveCell.FormulaR1C1 = "=SUMIF(C[1],""parent"",C[9])"
Range("D1").Select
'
If Application.Range("D1") > 0 Then MsgBox "You or Someone has entered estimated hours/dollars against a PARENT WBS Task. Parent level WBS Tasks are Sumary level items. There should never be estimate directly bid to a Parent."
'
Range("D1").Clear
'
End Sub
I want it to run when the user leaves the tab, but I am assuming "Deactivate" isn't what I think it is because its not working when I leave the tab. The code works if I run it. Is there a way to run this when they leave the tab?