Member Panel


Sponsors and Ads

Join the Team

Live Tag Cloud

PC Forum PC Help Forum » Software » Office Software » [Answered] Password protect macros on excel

Office Software - Password protect macros on excel posted in the Software forums; Hi 1st post on these forums. I recorded a couple of macros on excel last night, one hides certain rows then sorts by columns E and B then hides certain ...

JOIN US NOW to remove these Ads

Post New Thread  Reply
  #1  
Old 06-12-2008
ripps's Avatar
New Poster
 
Join Date: Jun 2008
Posts: 1
PC Experience: PC Illiterate
ripps - See this Members User comments on their Profile page
Exclamation Password protect macros on excel

Hi

1st post on these forums.

I recorded a couple of macros on excel last night, one hides certain rows then sorts by columns E and B then hides certain columns and protects the sheet. The other does pretty much the opposite, unprotects the sheet then unhides the columns, sorts by columns B and E then unhides the rows.

My question is can I password protect the macro button so only authorised people can use it?

The reason being the hiden rows and columns need to stay hidden and only certain people able to unhide them due to there being sensitive information on them.

If theres no way of password protecting this any ideas on how I can keep these rows and columns from being unhidden by unauthorised people would be a great help.

Thanks in advance for any help provided.


  #2  
Old 06-12-2008
madmonkey's Avatar
Site Manager
My PC
 
Join Date: Oct 2006
Location: South Wales
Posts: 5,723
PC Experience: PC Basket Ball Head!
madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page madmonkey - See this Members User comments on their Profile page
Default Re: Password protect macros on excel

Hello ripps, welcome to PCHF.

Excel does not have the facility to assign as password to a Macro itself. However there are some alternative ways that may help.

Password protect the Excel document itself
This is the easiest method, but won't work for you, if you want your users to be able to modify the document, but not edit protected cells.

You can assign both Read Only and Modify passwords, by going to File, Save As, click on Tools on the top right hand corner of the "Save As" window, followed by General Options.

Assign a password to Protect your sheet
When you go to Tools, Protection, Protect Sheet it will automatically request for a password to assign. If this is all the Macro does, then I don't see much point in creating a complete Macro to perform such a basic function.

Request for a password in the Macro itself
Edit your macro, and insert the following lines after the second line (sub):
Dim pw
pw = InputBox("Please enter Password:")
If pw = "pa$$w0rd" then

And the following just before the last line (end sub):
End If

This will work, however, it's not that secure, as anybody can go into the Macro and realise that the password is pa$$w0rd!

EDIT: Marked as Answered.


__________________


Last edited by madmonkey; 06-20-2008 at 01:11 AM.

Reply
New! Norton Internet Security 2008 – Download Now Click Here

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
explorer.exe crash on start up Obsidian [Fixed] Hijackthis! Logs 49 05-12-2008 12:37 AM
[Tutorial]File and Printer Sharing in Windows Vista Jelly Bean Windows Tutorials 2 02-12-2008 10:32 AM
Password Protect a DRIVE in XP Estochin Windows XP/2000 1 06-12-2006 07:22 AM
[Resolved] password protect a folder but there seems to be no way of doing it necronomicon Windows XP/2000 3 06-11-2006 07:24 PM


All times are GMT +1. The time now is 10:37 PM.
Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC7
All Graphics & Content Copyright © 2004-2008 - PC Help Forum.com


Back to Top