Input-Box for password & Monte Carlo

kmsoni

New Member
Joined
Jul 9, 2011
Messages
3
Hello Friends,

Plz help me with the below mentioned subjects

1. monte carlo simulation vba code

2. create an inputbox for password that pop-ups whenever workbook is opened and allows 3 attempts for password, and has special characters enabled to enter in inputbox

3. disable cut copy paste from ribbon and from shortcut keys


Plz help me friends. Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Maybe something like this which you can modify or use Userform which according to me is better....

Code:
Option Explicit[/FONT]
[FONT=Courier New]Private Sub Workbook_Open()
 Dim passwordentered As String
 Dim myCounter As Integer
 myCounter = 0
 
reenterpassword:
 passwordentered = InputBox("Please enter the password " & vbNewLine & _
 3 - myCounter & " numbers of attempts left... ")
 If passwordentered <> "[/FONT][EMAIL="Myp!@#$"][FONT=Courier New]Myp!@#$[/FONT][/EMAIL][FONT=Courier New]" Then
  myCounter = myCounter + 1
  If myCounter >= 3 Then
   MsgBox "3 Attempts over...."
   ThisWorkbook.Close False
   Exit Sub
   End If
  GoTo reenterpassword
 Else
 Sheets(1).Select
 End If[/FONT]
[FONT=Courier New]End Sub
 
Upvote 0
I like this. I will use it in a spreadsheet myself.
Thanks for the code!
PuJo
:biggrin:
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

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