I have a userform, and i applied the following in order to run the userform without showing the sheet
i need to add a button in the userform that enables me to open the sheet to edit it. and set a password so as no one can open it except me.
i.e. when clicking "Button1", a popup message requiring a password, and if the password is incorrect, it return a msg like "Wrong password", if the password is correct -->
Many thanks
Code:
<code style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-position: initial initial; background-repeat: initial initial; ">[COLOR=#00008B]Private[/COLOR][COLOR=#000000] [/COLOR][COLOR=#00008B]Sub[/COLOR][COLOR=#000000] Workbook_Open[/COLOR][COLOR=#000000]()[/COLOR][COLOR=#000000] Application[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]Visible [/COLOR][COLOR=#000000]=[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]False[/COLOR][COLOR=#000000] UserForm1[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]Show vbModeless[/COLOR][COLOR=#00008B]End[/COLOR][COLOR=#000000] [/COLOR][COLOR=#00008B]Sub[/COLOR]</code></pre>
i.e. when clicking "Button1", a popup message requiring a password, and if the password is incorrect, it return a msg like "Wrong password", if the password is correct -->
Code:
<code style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 1px; padding-right: 5px; padding-bottom: 1px; padding-left: 5px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 14px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: pre-wrap; background-position: initial initial; background-repeat: initial initial; ">Application.Visible = true</code>