Password Protection problem??

zilch4ry

Board Regular
Joined
Feb 27, 2011
Messages
76
Hi,

I found an answer on Google which said to add a code to the beginning of a macro which will then password protect the item before it can proceed.

The problem i have is when i run the code from the Developer tab-Macros-Imput1- Run the macro will work fine, but if i place this macro onto a shape i assigned as the 'macro button' it simply misses out the part which involves entering a password. Anybody know why this is happening:confused:

Any help will be much appreciated.

Here is my code:
Code:
Sub Input1()

If UCase(InputBox("Enter Password")) <> "password" Then Sheets("Input 1").Select

End Sub


Thanks,

Tom
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
What "item" are you trying to protect? The code you posted should run fine if assigned to a shape unless there is no sheet named "Input 1".
 
Upvote 0
Oh sorry i figured it out- i copied a shape which had a hyperlink on it ;) Thank you for taking the time to answer my question though, it means a lot
 
Upvote 0

Forum statistics

Threads
1,224,550
Messages
6,179,463
Members
452,915
Latest member
hannnahheileen

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