RE: Applying business logic in navigating between Worksheets

Dhimit

Board Regular
Joined
Jul 24, 2007
Messages
195
RE: Applying business logic in navigating between Worksheets

Hi,

Is it possible to prevent user 'toggling' to another worksheet unless it meets a condition in the current worksheet ?!

i.e 'Lock' the current worksheet until an action is completed.

Dhimit
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

ammdumas

Active Member
Joined
Mar 14, 2002
Messages
469
I beleive what you want is to add code to the following subroutine in MyWorkbook...

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
if 'your code looking at the required condition not met Then
'some witty message
End
else
'go ahead and switch sheets
End Sub
 
Upvote 0

Dhimit

Board Regular
Joined
Jul 24, 2007
Messages
195
Re:

Thanks for your prompt response.

Do you mind giving me the EXACT syntax since my business logic is quite simple :

IF (Worksheet Cell Value < 0) OR
(Worksheet Cell Value > 0)
THEN don't switch sheets
ELSE switch sheets
END IF

Do you also mind directing me where to place this code from the menu options ?!

Dhimit :biggrin:
 
Upvote 0

Forum statistics

Threads
1,191,706
Messages
5,988,188
Members
440,138
Latest member
yanaa

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
Top