A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi Daniel K, I'm Femi and I'd be happy to help you with your question. I understand that you are trying to make a code run when you deactivate 'Sheet 2' to go to 'Sheet 3', but not when you go to 'Sheet 1'. To do this, kindly make use of the code below: Private Sub Worksheet_Deactivate() If ActiveSheet.Name = "Sheet1" Then Exit Sub Else ' Your code here MsgBox "Code is running because you are deactivating Sheet2 to go to another sheet." End If End Sub
Kindly replace 'Your code here' with your actual code. This way, the code will run when you go from 'Sheet 2' to any other sheet except 'Sheet 1'.
Kindly let me know if this helps!
Best Regards, Femi