Protect The Macro

Jan 6, 2006

How can I protect a macro from other people changing it?

View 6 Replies


ADVERTISEMENT

Password Protect Columns - Hide And Protect Ability To Unhide

Jan 17, 2013

Some sensitive data is held on worksheets that are used by people that do not have access to see the data.

It would be most convenient to keep the data in these worksheets but hide it from view of the users.

Is there a way to password protect a users ability to unhide a column?

View 2 Replies View Related

Protect A Button Containing A Macro?

Dec 4, 2008

I have button on a worksheet that has a macro assigned. I need other people to see the workbook, but I want the button DISABLED for them to click, but able for me to click it. I have written in the macro to protect the sheet once it has run, but the button is still pressable.

View 2 Replies View Related

Password Protect A Macro

Oct 24, 2007

I currently have a macro which i run by selecting tools, macro, macro and then selecting the one i want and pressing run. if i press run I want a box to appear asking me to input a password and if password matches then run that specific macro, can this be done

View 2 Replies View Related

Password Protect Macro

Oct 22, 2008

Is there a way to password protect the macro code, so that someone can't open the coding?

View 4 Replies View Related

Macro To Protect Sheets

Mar 20, 2008

I have a workbook with some sheets password protected and other sheets not protected.

I have a macro that unprotects the sheets, but it requires the password to be typed multiple times.

I want to put the password into the macro so it doesn't require manual entry of the password lots of times.

Each sheet has the same password, so I would expect to enter it for the first sheet only.

What I have came from a simple macro recorder selecting each sheet in turn:

Sheets("wages").Select
ActiveSheet.Unprotect
Sheets("Comparative").Select
ActiveSheet.Unprotect

View 9 Replies View Related

Protect Sheets Using Macro ..

Sep 16, 2008

i use a macro to protect several sheets in a workbook.

When i protect the sheets, i only want to be able to cells and nothing else. How should i mdify the code below to do this? I tried record the macro and un checking the "select locked cells" box which is one of the only 2 boxes checked. It works, but then when i save the wb and re-open it it allows me to select locked cells.


Sheets("FF - WC").Select
ActiveSheet.PROTECT DrawingObjects:=True, Contents:=True, Scenarios:=True

Sheets("FF - UR").Select
ActiveSheet.PROTECT DrawingObjects:=True, Contents:=True, Scenarios:=True

View 9 Replies View Related

Macro To Protect All But One Sheet

Aug 21, 2008

Greetings I have a workbook with many sheets and i want a macro to protect all the worksheets with certain settings except for one sheet, sheet 3.

I have borrowed some code from this page that I cannot get to work and I would appreciate any help. the code should also have an if statement that unprotects sheet 3 but i don't know how to do that either. I just get syntax errors

Private Sub Workbook_Open()

Dim wSheet As Worksheet

For Each wSheet In Worksheets

wSheet.Protect Password:="secret", DrawingObjects:=True, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingRows:=True, AllowDeletingRows:= _
True _

.EnableSelection = xlUnlockedCells
.EnableOutlining = True
Next wSheet
End Sub

View 9 Replies View Related

Using Macro To Protect And Unprotect Worksheets

Oct 23, 2008

I am looking for a way to protect and unprotect all worksheets with a password through a macro. I have excel 2007.

View 2 Replies View Related

Password Protect Added To Macro

Sep 10, 2009

I have recorded the following macro and wish to add unprotect (with password), run the macro - which formats the worksheet and then password protect all cells with the exception of range E15:H413 which I want to leave editable by users.

View 9 Replies View Related

Macro Error After Protect File

Jan 4, 2010

I created excel form with calculated formula and macro. Everything worked fine. To protect spreadsheet formula I protected file. But after protection when I ran file I get macro error message. Then I remove protection become work without error messgae. How to fix that problem?

View 6 Replies View Related

Force To Save / Protect Macro

Dec 17, 2009

I've created a file where our accountmanagers can mace price calculations. But eversince i've added a macro to force them to fill the form completely, they have gone and tried to hack the macro (and with succes).

I now would like to add a protection for the macro, so they can only access VBA when "sheet1" is unprotected. How can i do this?

I also would like to create a macro so they only can save the file as a Macro Enabled Excel file (.xlsm),

how can i do this best? .....

View 9 Replies View Related

Protect Sheet With Macro Buttons

May 9, 2006

I have two macro buttons on a page that hide and unhide columns. When I got to protect the sheet .. the buttons no longer work and ask me to DEBUG. Is there a way to have macro buttons performing tasks AND have the sheet still protected?

In the protect sheet window .. am I have ticked is

Select Locked Cells
Select Unlocked Cells

But these are ticked as a default.

View 2 Replies View Related

Macro: Protect & Unprotect Sheets

Nov 9, 2006

Is there an easy way (using a macro) to unprotect and protect sheets?

Most sheets in a certain workbook are protected except a few cells that are open for manual entry. Because I have links to other cells in other workbooks, I must unprotect those sheets/fields before I can edit the links. And I MUST ensure all sheets are protected again when I'm done with my work.

Also, is it possible to password-protect that specific macro so I'm the only one who can run it to unprotect and protect?

View 9 Replies View Related

Password Protect Macro From Running

Dec 5, 2006

i want to make a macro available just for me with help of a password, so that the other users can't run this spesific macro without this password.

View 5 Replies View Related

Password Protect Macro From Running ..

Jan 31, 2008

I need my people to run all kinds of macros, but I want to password protect one of them.

View 6 Replies View Related

Password Protect Multiple Sheets With Macro

Jul 12, 2013

I have a spreadsheet with over a hundred tabs, each of which need to be password protected (same password).

I found code on CFO.com that got me half way there. It protects all the spreadsheets, but it does not password protect the macro itself, meaning that anybody can step into the macro and unlock everything at the click of a button.

The code looks like this.

VB:
Sub ProtectAllSheets()
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="secret123"
Next ws
MsgBox "All Worksheets Protected"

[Code] ....

What can I do to prevent people from stepping into the macro, or prompt a password to actually use the macro itself?

View 1 Replies View Related

Macro To Prompt Protect Sheet Box On All Tabs?

Jun 20, 2014

Macro to Run all tabs in a workbook and prompt a pop up asking about sheet protection for each tab, such as Select locked cells, and select unlocked cells.

View 8 Replies View Related

Protect Worksheet Without Affecting Macro Functionality

Oct 15, 2008

I've attached an excel invoice template I've been making for our company. I'd like to protect all the cells except A12:H42, C8, B9, G4 and I44. The problem is, if I protect the worksheet (with these cells unlocked) then it won't let me run the macro (for inserting new rows for extra products).

View 5 Replies View Related

How To Protect Colored Cells In Excel Using Macro

Jan 11, 2014

How to protect only the colored cells in excel sheet which has formulas in it and it is a sale sheet because i do not want my team to mixup with the formula.

View 9 Replies View Related

Macro To Protect Cells Based On Formatting

Mar 11, 2014

I build a lot of spreadsheets at work that I email out and the person I send them too has to enter information in the cells highlighted in yellow. Since not many of the end users are too computer savvy I lock and protect all the cells that they shouldn't be changing.

This can take forever, is there any way to have all the cells in a worksheet become locked and protected based on the formatting they have? All cells that aren't yellow?

View 9 Replies View Related

Macro To Write Protect A Worksheet With A Password

Dec 10, 2006

I'm trying to protect a worksheet with a password using macro.

View 9 Replies View Related

Password Protect/Unprotect Dialog Macro??? !

Mar 4, 2007

Stumbling over syntax on what should be easy. I want to password protect the active sheet using plain vanilla user input box; and then unprotect ALSO via an input box. Doesn't matter about masking the input with **** or whatever. Based on responses below, here is macro code I used:

To protect the sheet:

Sub ProtectSecurity()
Dim pword As String
pword = InputBox("Enter Password", "Password")
ActiveSheet.Protect pword
End Sub
---------------------------------
To Unprotect the sheet:

Sub UnprotectSecurity()
Dim pword As String
pword = InputBox("Enter Password", "Password")
ActiveSheet.Unprotect pword
End Sub

View 5 Replies View Related

Amend Current Macro To Protect All Sheets...

Mar 4, 2007

I have a Macro to protect all the Months sheets in my Time sheet to stop users deleting formulas, This year I've added a new sheet with a yearly calender so users can track Hols etc but when I run the Macro it protects this sheet "2007-2008". How can I amend the Macro so it protect all sheets except "2007-2008". My Macro is below:

Sub ProtectAll()
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="KITCHENsink19591968", DrawingObjects:=True, Contents:=True, Scenarios:=False
Next ws
ActiveWorkbook.Protect Password:="KITCHENsink19591968", Structure:=True, Windows:=False
Application.ScreenUpdating = True
End Sub

View 4 Replies View Related

Protect Sheet But Allow Macro Code To Modify

May 24, 2008

I am trying to design a tool which dynamically results in different cells depending on users inputs. Yet, I am willing to protect most of the cells to avoid any user involuntarily (or voluntarily!) modifying the formulas/contents of the calculated (and locked) cells. Is there any way to protect my sheets, allowing only a certain macro to modify the locked and protected cells?

View 4 Replies View Related

Code To UNPROTECT Then PROTECT Workbook When Macro Runs

Jul 24, 2014

Okay, I have this code and it works very well - but it only works if my WORKBOOK is unprotected. I know how to Unprotect then Protect an ActiveSheet, but I can't figure out how to Unprotect then Protect my workbook when the macro runs..

Sub BLM_RENAME_SHEET()
Dim WS As Worksheet
Application.ScreenUpdating = False
For Each WS In ActiveWindow.SelectedSheets

[Code] ......

View 9 Replies View Related

Enable Macro & EnableEvents Problem To Protect Sheets

Mar 21, 2007

I am trying to crack away to protect my workbook, by forcing users the enable macros on launching.

What I am trying to do is if Workbook_BeforeSave runs a routine called DoIt. This calls HideAll, saves, then calls ShowAll al whilst not updating. (ie so the user is non the wiser and the computer does not asked to save again if no changes are made).

The reason I am trying this is so that if the user closes the document, it will not ask them again to save. Instead it has preserved the state in the HideAll place (ie all important worksheets are VeryHidden.

It is only by enabling Macros on open can the ShowAll make them visible again.

Below is the code I am using and it works, except it seems the Application.EnableEvents = False in the DoIt macro does not seem to be doing what it should.

very dearly love to get an answer as it is driving me up the wall!

Module 1:

Public bIsClosing As Boolean
Dim wsSheet As Worksheet

Sub HideAll()
Application.ScreenUpdating = False
For Each wsSheet In ThisWorkbook.Worksheets
If wsSheet.Name = "Warning" Or wsSheet.Name = "Authorise" Then
wsSheet.Visible = xlSheetVisible
Else
wsSheet.Visible = xlSheetVeryHidden
End If
Next wsSheet
Application.ScreenUpdating = True...............................

View 9 Replies View Related

Workbook Enable Macro Protect / Unprotect The Sheet

Sep 4, 2009

I need a macro that I can have in any workbook enabling me to protect / unprotect the workbook that I have currently opened with a set password (let say "Password")

I would link this macro to a button in excel 2002. I have try the following but it doesnt work

Would it be possible that the button (first) works (second) understand whether or not protect / unprotected and do the opposite?

Sub Protect
Activeworkbook.protect password:="password", structure:=FALSE, Windows:=false
End Sub

View 9 Replies View Related

Macro Paste Special, Protect, Delete Worksheets

Jul 19, 2007

I am looking for a macro that can do one of two things. I am not sure which way I want to go with this yet and how automated it should be. Either scenario will result in a significant time save.

Scenario One
1. Copy & Paste Special Values on the selected/active worksheet
2. Protect Selected Worksheet with password "1234"
3. Delete ALL worksheets except the selected/active worksheet from the file. Names of other sheets can be various and are not static

For example:
A workbook has the following: sheets1, sheet2, sheet3, sheet_unknown_name
If you are working in sheet1 the macro would copy paste special values the entire sheet, protect sheet1 with the password "1234" and delete any and all other sheets.

Scenario Two
1. Copy & Paste Special Values on the selected/active worksheet into a new workbook
2. Protect the new workbook with password "1234"
3. Rename the new workbook with the original workbook name adding either "em_" to the front or "_em" to the end of the filename
4. File, Send To, Mail Recipient as attachment.

View 4 Replies View Related

How To Create Macro In Order To Protect Data Validation Rules

May 15, 2014

create macro in order to protect Data Validation rules.

e.g. If user copy and paste cells from others source which is not in the same validation criteria or not contain any validation rules, the existing validation will gone.

so, is there any macro which will be able to automatically run to prevent the data validation?

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved