Stop if condition is met and continue with next loop

Status
Not open for further replies.

Nicobisgaard60

New Member
Joined
Sep 4, 2016
Messages
14
I am using a classic password-breaker macro to unprotect sheets. Now i want to unprotect all sheets, and unprotect the workbook in one macro.

The password breaker macro needs a "End" or "Exit sub" to not run wild, but after it finds the password of sheet 1, i need it to break out of the loop and continue on to the next loop. I can't figure out how to get the syntax for this working.

My code looks like this currently:


When i run this, the "End" after Msgbox makes the macro stop completely where i would want it to just stop the current loop and continue doing things afterwards.
 
Last edited by a moderator:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Please do not ask questions, or post code, relating to password breaking.
This is contrary to the rules of the board.

Rule #6:
The policy of this board is NOT to assist with the breaking of any forms of security under any circumstances. Such posts will be deleted or locked.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,430
Messages
6,119,447
Members
448,898
Latest member
drewmorgan128

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