Protecting A Worksheet That Contains Macros

Jun 5, 2009

I need to protect the attached to stop people deleting the formulas. The problem is that there are hidden macros and when i protect the cells the conventional way they stop working and i lose all the data in the IAS sheet. I have highlighted all the cells in yellow that i want to be able to change once protected.

At this stage I would just like some one to explain how to protect it. Ideally I want to do it normally (unlock the cells individually that I want to remain unprotected, then protect the whole sheet). If its not then presumably its a macro alteration that's needed?? don't do it at this stage as depending on how it will be protected will mean that i need to make a few adjustments.

View 3 Replies


ADVERTISEMENT

Protecting MACROS

Mar 16, 2003

Could there be something that will not show the macros and also make it impossible to edit them (but ofcourse let me have access when I need to change soem thing, password may be? )

Having to talk about password, let me tell you that, I did try and put a password inside the VBA but it didnt seem to make any diff uzzled:

View 8 Replies View Related

Protecting A Workbook But Still Able To Run Macros

Mar 7, 2008

is it possible to protect a workbook but still run various macros, i have tried this and the macros wont run

View 10 Replies View Related

Encourage Enabling Of Macros: Disable Macros When Opening Then The Worksheet Menu Bar And Other Command Bars Are Still Available

Aug 26, 2009

I have an Excel 2003 program that contains macros. One of the macros hides certain command bars and disables the worksheet menu bar. On close the opposite is true. The problem is, if a user uses the disable macros when opening then the worksheet menu bar and other command bars are still available. I would like to hide all of the data sheets and display another sheet that would normally be hidden displaying a message that the macros have to be enabled for the program to work correctly if disable macros is chosen. When the enable macros are used I would like the Error page to be hidden.

View 6 Replies View Related

Password Protecting More Than One Worksheet

Dec 22, 2008

I have set up a workbook with a tab for each month. in the workbook open module i have the following code (below marked Password protect) that allows for three passwords to unlock certain ranges of cells, what i would like to do is for this code to apply to each worksheet.

Now in the main this works except for one range of cells H11 to H1000, on every sheet all cells are locked except for this range which is unlocked in every sheet except sheet one when you enter the password staff. The only other code i have is for a time stamp (marked time stamp) so that i can monitor when the user has entered data. this again has reference to the sheet name.

their must be something really straight forwad i am doing wrong here as everything works on an sheets except this range being locked.

I am in excel 2002 but my users are on 98, which is why i am protecting in VB rather than using the prtect range option.

View 7 Replies View Related

Protecting Worksheet - With Password

Oct 26, 2009

modify the code below to do the following:

When I recorded this macro shown below, I entered in a password (twice) as prompted by Excel 2003.

So when I run this code, it seems to work fine. However, when I want to unprotect the worksheet, I am not prompted to enter in the password.

modify the code so that when I need to unprotect the worksheet, I am prompted to enter in the password?

View 12 Replies View Related

Protecting A Worksheet With A Macro

Oct 27, 2009

I am looking for code which will protect a worksheet based on the value of a particular cell.

i.e. If cell A1=1, then the worksheet will be protected (ideally with a pswd)

View 5 Replies View Related

Protecting Worksheet But Only Cells

Jul 21, 2006

I have a spreadsheet with about 2000 lines of vba code. My application needs to be protected so users don't mess themselves up; however, I really only needs the contents of cells to be protected. I have many macros that run, and in order to do this I need to unprotect and re-protect the worksheets. My problem is this: when I re-protect the worksheets, everything is locked up. I would like to allow users to change column widths, hide and un-hide rows, etc. I can't find the parameters needed to do this more controlled type of locking. Is there a list somewhere of all the parameters that can be passed to the Protect method? Here is my current subroutine:

Sub ProtectSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="password"
Next
End Sub

View 4 Replies View Related

Protecting Given Area Of Work In Worksheet?

Apr 17, 2014

I am working in the D3:K20

I have set my column width at 3.6 and row height at 19.6

I want to protect this area so that the column width or row height don't change.

View 1 Replies View Related

Using Text Box Whilst Protecting A Worksheet

Jan 25, 2008

I wish to protect a worksheet to prevent loose fingered people from altering formulas, but I want the "text box" that is below these formulas (within the same worksheet) to be able to be typed in.

But when I protect the worksheet, the text box cannot be typed in.

Is there a way around this to allow typing in the text box whilst the sheet is protected?

View 9 Replies View Related

Protecting Worksheet With Macro (Run Time Error '1004')

Jan 28, 2009

I am using the following code to enable users of a form to made make selections by adding a tick in one of the boxes by clicking on it. It works fine with thesheet unpotected but when I protect the sheet with cells E33:k33 unlocked i get Run Time Error '1004'

Unable to set the Name property of the font class.When I debug, Target.Font.Name = "Marlett" is highlighted.

View 4 Replies View Related

Excel 2007 :: Protecting Worksheet / Workbook On Save?

Nov 24, 2011

Intention is to (automatically) fully protect each completed worksheet/workbook on "save"/"save as" in MS Excel 2007... Is this possible by means of a macro? Which one? Saving in a ".xlsm" format is required?

View 9 Replies View Related

Creating Macros To Transfer Data From Worksheet To Worksheet?

Mar 26, 2014

transferring data from a worksheet (Passdown Report) to another worksheet (Data Base) located in the same workbook. In the source worksheet (Passdown Report) there are 2 cells (B2 and D2) in which I would like the data to be transferred along with the data from B4 to AQ33. All the cells contain a formula which I want to stay after the information is transferred to the target worksheet (Data Base). This will be a daily transfer to the target worksheet (Data Base), so the macros should also identify the next available open row to transfer the data to.

View 1 Replies View Related

Macros To Next Worksheet

Jan 14, 2010

I have question about next worksheet, let say I have VB code that’s Run on sheet1, but Sheet2 to Sheet 7 al so needs after sheet1 finished, same format on at sheets.

View 9 Replies View Related

Worksheet Functions In Macros

Aug 2, 2009

I've been reading about usage of worksheet functions in macros, and I guess I'm still not getting it. What I want to do, is use Countif and Indirect worksheet functions in a macro but it always fails. Here is my formula

IF(Worksheetfunction.Countif(Worksheetfunction.INDIRECT("[DaysWorking.xls]'Collect No Stats'!$A:$A"),'2009'!Range("D" & x))>0)

Basically, I want to see if 2 different cells in 2 different workbooks match and then I would use the information to write different info in another cell. X is just a variable in a DO WHILE LOOP. Can these functions be used in a macro? Is there an alternative?

View 3 Replies View Related

Delete All Macros From Worksheet

Nov 3, 2011

It's simple enough to delete all macros. I have a form that starts as a landing area for a bunch of data then it gets renamed. I want to delete both of my command buttons from the sheet and remove all of my macros. How am I going to pull this off, how can i save it to the sheet the first time?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
'cut command buttons
ActiveSheet.Shapes("CommandButton1").Select
Selection.Cut
ActiveSheet.Shapes("CommandButton2").Select
Selection.Cut

[Code] .........

View 1 Replies View Related

Using Two Change Macros In One Worksheet

Apr 18, 2013

I have a worksheet "OPEN", and would like to apply both:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim i As Long
Set rng = Target.Parent.Range("B:B")
If Target.Count > 1 Then Exit Sub

[Code] .........

The first removes the rows if the validated column 'B' is equal to "closed", to a second worksheet "CLOSED". The second orders the rows by the same column, followed by column 'A'. Being brand new to macros, I've no clue how to make this happen...

View 2 Replies View Related

How To Remove Macros From Only One Worksheet

Aug 23, 2009

I have a website that I have been posting filtered worksheets of specific formats of items for interested viewers to view. The Looker can click on the Button and Open or Save a Copy of the Worksheet. I hide unused rows and columns to reduce size.

I filter my main worksheet to find the item type that I want to isolate - I copy the Result to another file - Run a Macro to Remove the information that I dont want to show. Hide Unused rows and Columns. Save as my File name and Upload to the Website.

BUT -- In my Excel Workbooks I have Macros - Some in the personal file. Some attached to Specific Files. When the Viewer clicks to see the file -- it offers the Macros ( Enable or Disable ). This Scares off many viewers and they Cancel.

When I delete the macros and save -- it deletes the Macros from MY computer as well.

How can I remove Macros from only the Sheet that I want to post for my website.

Here is the URL of one of the Current Buttons to a posted file if you care to view and see what I mean and am attempting to do.

View 9 Replies View Related

Keeping Macros When Copying A Worksheet

Mar 12, 2012

I've managed to be able to create a macro to make a copy of a worksheet within excel.

However, when that copy is create all the macros are lost. If it is not possible to copy all the macros that are within the "Original Hours" sheet, I at least need a macro that will take people back to the original hours sheet (we have disabled sheet tabs, so need the macros to navigate through the worksheet).

Code used is below

Private Sub Hours_Click()
Sheets("Original hours").Copy After:=Sheets("Original hours")
ActiveSheet.Name = "Update hours"
ActiveSheet.Unprotect "PASSWORD"
With ActiveSheet.UsedRange
.Value = .Value
Sheets("Update hours").Select
End With
End Sub

View 7 Replies View Related

Creating Macros To Search Worksheet

May 2, 2008

Am a newbie in excel macros. pls i need assistance as to how to create a macro that searches a worksheet for a particular word. i wrote something like below but am having problems in it.

Private Sub CommandButton1_Click()

Dim word As TextFrame

If word Is Not Empty Then
For word = "aaaaaaaaa" To "zzzzzzzzzz"
ThisWorkbook.Worksheet.Find
Next word
End If

End Sub

View 9 Replies View Related

Macros & Formulas Paste Into A Worksheet

Aug 6, 2008

I have a formula which i need to paste into a worksheet, doing this is tedious and boring to say the least, problem is i am not sure how to get the macro to skip blank lines and only insert the formula where there are prices. Each week the worksheet changes so there is no consistent layout.

View 9 Replies View Related

Enabling Macros Without Re-opening Worksheet

Aug 25, 2006

if you open a workbook & choose not to enable macros, is there any way to later change your mind & set macros to enabled without having to close & reopen the workbook?

View 9 Replies View Related

Change Name Of Worksheet On Open Without Macros

Aug 30, 2006

I'm trying to avoid using macros in my workbook, however, I'm unable to get my worksheets to change name (based on a named range) without use of them, as follows.

I've written the macro:

Sub MyMacro()
ActiveSheet.Name = Range("MyRange")
End Sub

and then dropped the following into the worksheet
Private Sub Worksheet_Activate()
Run "MyMacro"
End Sub

This works fine, but I'm trying to avoid using macros. When I try to place the following script in the worksheet private code, nothing happens:

Private Sub Worksheet_Activate()
ActiveSheet.Name = Range("MyRange")
End Sub

View 9 Replies View Related

Macros To Change Generated Worksheet File Name

May 2, 2014

I have a file here that already has macros in it. The file is basically a excel document generator.

When you click create sku, the document will generate multiple documents based on the user inputs.

Two things in this file

1) In the generated documents the original "generator" file creates, I need generated files to have column B and D formatted to TEXT, currently all the generated files are formatted to general. (This code is in module 1, line 84 col 34.)

2) The other problem is I need to append the value in Cell N1 in the "sku data entry" sheet to be appended to the generated file names. (this part of the code is is in module 1, line 150 col 28.)

View 1 Replies View Related

Macros Wont Work When I Protect My Worksheet

Sep 14, 2009

I have the follwing macro that is used to hide certain rows: ......

View 11 Replies View Related

Combine Two Macros In Same Worksheet Change Event

Oct 1, 2013

combine two Worksheet Change event macros into the one macro? The macros are listed below.

Code:

Private Sub Worksheet_Change(ByVal Target As Range)On Error GoTo exitHandler
Dim rngDV As Range
Dim lRow As Long
Dim lCol As Long

[Code]...

exitHandler:

Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("O:O")) Is Nothing Then
Application.EnableEvents = False

[Code]...

View 7 Replies View Related

Macros To Print Worksheet To PDF And Email To Recipients?

Mar 4, 2014

I have been trying to write a couple of macros;

1) save file as pdf, to be saved as filename=(cell in A1 & todays date (format yyyy-mm-dd)) and overwrite any existing file of the same name.

2) Email the pdf to a set of recipients round in Range "A2:A3", and subject = (cell in A1 & todays date (format yyyy-mm-dd))

View 5 Replies View Related

Save Worksheet Final Draft But Not Macros

Sep 29, 2009

I have a complex sorting macro with userforms & Modules. Works great! Now I need to save the final Worksheet without the macros. The final step to my project is a Application SaveAs. Can I add a delete-all-macros step when the user clicks the Save As button which would create a new workbook with the finished worksheet and NO macros?

View 9 Replies View Related

Copy Entire Worksheet Including All Macros And VBA Code

Dec 16, 2008

I need to copy my worskheet multiple times to create about 10 of the same worksheets within a workbook. I know if you click in the very most top left hand corner of the worksheet, then click copy, go to the new worksheet and click paste, it copies the whole page, but it does not copy over the VBA Code.

Also, for some reason, it does copy over my macro buttons, but does not put some of them in the right spot?

View 6 Replies View Related

Excel 2010 :: Macros - How To Update Active Worksheet Only

Oct 7, 2011

I am using excel 2010.

I have a macro-based employee leave system that works by couting the number of days shaded with a certain colour and thus calculating leave days taken, remaining and entitled... I have a single workbook with multiple sheets for different employees.

However, when I update by using ctrl alt f9, it updates all the other worksheets (ignoring their shading) with the values of the active worksheet! So if I update Peter, who has taken 14 days so far, it will update Liam's sheet too, with 14 days, ignoring Liam's actual shaded days...

How can I update each sheet individually, without compromising the other sheets?

Excel is not responding to Shift - F9.

View 3 Replies View Related







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