VBA Locked And Unable To Even Get To A Place To Unlock?
Jul 30, 2014
Some how my spread sheet became shared and has been locked. so when I went to use my VBA to unlock the sheet i found my project locked as well and no way to get to properties to try and unlock.
View 3 Replies
ADVERTISEMENT
Mar 15, 2012
I am getting a message, the Excel file i am opening (xlsm) is locked for editing by 'another user'. But, NOT SO, of course; i am the only user logged in to this PC, and there is no network access. I quit Excel and verified that i see no Excel processes running. But, when i try to open the file, i still get the "locked by 'another user'" message, and at this point can only open read-only. I looked in the folder the file is in and do not see any of those ~ files or anything else suspicious.
So, what do i do? How do i "unlock"? How can i open this file once again to make modifications to it?
View 7 Replies
View Related
Jun 14, 2013
I was sent a file via email and when I opened it the data option on the top on the ribbon was locked and I need to ungroup rows.
View 2 Replies
View Related
May 1, 2014
The problem is coming from the Else statement.
Code:
Sub LockByColor()
ActiveSheet.Unprotect "pc"
Dim cl As Range
For Each cl In Range("$BO$1:$BZ$45")
If cl.Interior.Color = 6299648 Then
cl.Locked = True
Else: cl.Locked = False
End If
Next cl
ActiveSheet.Protect "pc"
End Sub
View 5 Replies
View Related
Sep 22, 2008
Sheets("PRODUCTIVITY").Select
Range("A20").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
With Selection
.Locked = False (***debug screen is highlighting this line***)
.FormulaHidden = False
.ClearContents
End With
Range("A20").Select
ActiveCell.FormulaR1C1 = "PASTE NEW DATA HERE"
Range("A20").Select
This worksheet was built for use of many users so this sheet is PROTECTED.
The user is instructed to copy/paste information from our internal web into the selected areas in the worksheet.
When i UNPROTECT the worksheet the VBA works fine.
The data in the worksheet spans from columns A to P, and the length (# of records) is variable.
View 9 Replies
View Related
Jul 17, 2007
I am using the below code to unloock certain columns based upon a value in cell a1. The value is the previosu month end date. It was working, but now I am getting " run-time error 1004 Unable to set the locked property of the range class" Can anyone help me to fix the error.
Sub UnlockMe()
Dim cl As Range
ActiveSheet. Unprotect "password"
For Each cl In Range("$B$1:$M$1")
If cl = [a1] Then
cl.EntireColumn.Locked = False
cl.EntireColumn.Interior.ColorIndex = 6
Else
cl.EntireColumn.Locked = True
cl.EntireColumn.Interior.ColorIndex = xlNone
End If
Next cl
ActiveSheet.Protect "password"
End Sub
View 2 Replies
View Related
Oct 27, 2011
I have a sub that I have copied out of a previous workbook where it still works fine. In the previous workbook it was assigned to a button. Now I am trying just to do it as an automatic action when the workbook is closed
It will lock any cell within the specified range that is not blank then protect the worksheet, save the workbook then save a dated archive copy
When I pasted it in to a new workbook I changed the range to A1:AP49 and strFileName
Now when I run it now I get an Error 1004 - Unable to set the Locked property of the Range class.
On Debug this line is highlighted:-
c.Locked = c.Value ""
The full code is:-
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'
' Lock_cells Macro
' Macro compiled 10/26/2011 by G CARNCROSS
' Locks used cells, saves the workbook then saves a password protected copy with the days date in the file name then closes the workbook
'
'
ActiveSheet.Unprotect Password:="SHES"[code].....
View 2 Replies
View Related
Feb 22, 2007
I am after a macro to do the following, my visual basic skills are very limited (non existant):- Look at the date in cell A1 on Sheet 'Live Report' and err 'remember it' Copy a range of cells from A3 to A10 on 'Live Report' Go to sheet 'Monthly Summary' and find the date that had been remembered previously (this date will be in column A on 'Monthly Summary' which will probably be a mixture of values and formulas). After the date has been found paste special and transpose the 'values only' copied range from 'Live Report' (A3 to A10) in column B on 'Monthly Summary' next to the date that has been found in Column A.
View 2 Replies
View Related
Oct 19, 2006
I have a macro that imputs data from an external database and puts it into a temporary worksheet. This data has 3 columns (ID, Date, Amount). I am then making another sheet which has X number of tables (one for each ID), with the years being the column headings, and months being the row headings. ie.
| ID X
| +------+------+------+--->
| | 1999 | 2000 | 2001 |
+------+------+------+------+--->
| Jan | $100 | $250 | $300 |
+------+------+------+------+--->
| Feb | $200 | $300 | $200 |
+------+------+------+------+--->
| Mar | $300 | $250 | $100 |
+------+------+------+------+--->
| Sum | $600 | $800 | $600 |
| +------+------+------+--->
| ID Y
| +------+------+------+--->
| | 1999 | 2000 | 2001 |
+------+------+------+------+--->
| Jan | $100 | $250 | $300 |
+------+------+------+------+--->
| Feb | $200 | $300 | $200 |
+------+------+------+------+--->
| Mar | $300 | $250 | $100 |
+------+------+------+------+--->
| Sum | $600 | $800 | $600 |
| +------+------+------+--->
Currently I have a few hidden fields for the DSUM Criteria. I start making the tables. And then filling in table based off of the month and year. Doing so I need 3 criteria:
>= First Day of the Month
<= Last Day of the Month
= ID #
The problem is it takes Excel too long to fill in the 3 criteria fields, calculate the result, copy the result, and place it into the correct place on the table. Is there another way to get this data into the correct tables faster? Instead of using DSUM?
View 8 Replies
View Related
Sep 27, 2006
I have a file where I can not enter the VBAProject. If I click on it I get an error message and when I try to get into the Properties of the Project I get the same Message. The error message is "Project locked" (in german). I locked the file my self some month age, all passwords are saved but i am not asked to enter one. I think that i can remeber I was writing a macro in a nother file that locked and unlocked this specific file.
View 3 Replies
View Related
Apr 23, 2007
I have a shared file that is now mysteriously locked. How can I unlock the file so changes can be made?
View 4 Replies
View Related
Nov 8, 2013
After going through some posts in this site, I found that, we can use custom validation for locking a cells when the condition is not met.I have tried using that, But I am not able to get it correctly.I have attached the sheet for your ref.
What I want is, when I enter a month in A2 (Which will always be the 1st of that month), that particular column should get unlocked/should be able to edit that month's column only. I have just provided on table here, but what I want is for entire column so that, I can use the same formula for a larger sheet
View 3 Replies
View Related
Mar 6, 2009
code that will unlock cell g12 and af9 when cell e9 equals "WF-"
Basically I need it to say (I really don't know how to write code)
If "E9"="WF-" unlock "G12" and "AF12"
If not, clear contents of "G12" and "AF12"
View 11 Replies
View Related
Mar 19, 2009
I want to let the user unlock certain cells but only after they have clicked a button. To notify that the cell is unlocked I also want it to change colour.
Is this possible?
I have attached a small example. Password is mg
unlock.xlsx
View 6 Replies
View Related
May 15, 2008
I have an lock button to lock a worksheet, and a unlock button to unlock the same worksheet.
The unlock button though gives me an error when I don t set the password correct or not at all.
My code is like that
Sub UnlockSheet()
'
' Unlock Sheet Makro
'
'
ActiveSheet.Unprotect
End Sub
I am sure that is very simple for you guys here but for me a problem I can not figure out yet why.
View 9 Replies
View Related
Aug 7, 2007
Is it possible to lock/unlock the VBA code in a workbook through VBA from another workbook? I wish to copy modules from one workbook to another, both workbooks will have the VBA code password protected to stop prying eyes. Obviously I need to unlock the VBA in the target workbook before the copy and lock it again afterwards. Can this be done programatically? If there is no function in VBA to do this can you provide an example of how to do it using SendKeys if that is the only way to do it?
View 3 Replies
View Related
Sep 13, 2013
What if you forgot the password in a protected sheet? is there a way to unlock it?
View 1 Replies
View Related
Jul 4, 2014
I have a table and need to protect the sheet. From searching I see its a common problem as the table wont auto expand on a protected sheet.
I was thinking maybe I could create some sort of change event so if a user selects cells on Column A,B,G,H rows 13-1000 the sheet will auto unlock then lock again once they leave those cells.
I think it may need a few seconds delay to give table chance to autoexpand before sheet is locked again.
View 3 Replies
View Related
Oct 4, 2007
How I can unlock a range of sheets that are password protected in my workbook.
I have 20 identical sheets one for each department which are protected by the same password.
It would be nice if I could rapidly lock and unlock these sheets.
What I need a set rng command in conjunction with a For Next loop?
View 12 Replies
View Related
Jan 30, 2009
Unlock columns if Column is not blank in any row
Using VBA
On Sheet("Draft Final") , search every row and
If Col A is not blank, then unlock Columns G: M and unlock Columns O:U
View 4 Replies
View Related
Sep 13, 2012
I have the unlock/lock code below but i cannot get it to unlock the correct spreadsheet. Where do i need to place it in the code so that it will work properly.
Code to unlock:
Public Sub unlocksheet()
'unlock the worksheet
On Error Resume Next
ActiveSheet.Unprotect Password:="test"
Within this code:
Private Sub cmdSub_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("AFW")
'find first empty row in database
[Code] .........
View 1 Replies
View Related
Nov 9, 2012
I have a worksheet with active range A9 thru K200 that is locked. When worksheet is opened, I need it to automatically unlock all rows that are blank, for users to input data. It would be great if this could also require data in column A, C and K before allowing workbook to be saved and closed.
View 2 Replies
View Related
Apr 4, 2014
I have a workbook whose worksheets I want to protect on open, and also want to unprotect by way of a module. The protect code is:
Code:
Private Sub Workbook_Open()
Sheets("Cornealrings").Protect Password:="elohim"
Sheets("Ferrararings").Protect Password:="elohim"
Sheets("Kera Rings").Protect Password:="elohim"
Sheets("IS CALCULATOR").Protect Password:="elohim"
Sheets("IS Manager").Protect Password:="elohim"
End Sub
The unprotect code is:
Code:
Sub Unprotect()
Sheets("Cornealrings").Unprotect Password:="elohim"
Sheets("Ferrararings").Unprotect Password:="elohim"
Sheets("Kera Rings").Unprotect Password:="elohim"
Sheets("IS CALCULATOR").Unprotect Password:="elohim"
Sheets("IS Manager").Unprotect Password:="elohim"
End Sub
The code stops at the first line of the unprotect event, with the message that the password is not correct. If I try to manually unprotect, the password is accepted.
View 7 Replies
View Related
Apr 14, 2008
I have a sheet that upon opening a macro runs to hide a selection of columns based on cell containing certain words (see here).
I now also require the workbook to be protected so that the hidden columns (which Im sure are locked as default when hidden) are locked as are columns N & S. Now, I know I can do this by protecting the sheet and unprotecting the columns I require (ie N & S - with the hidden cells remaining locked anyway).
The issue is, every time the workbook is opened this protection must be in place.
However, I require a button, which could simply reside in A1, that when pressed, will unhide and unlocked all cells. - This is needed as its vital I can easily copy rows to another sheet (and delete from existing sheet) as and when required.
if possible, re-pressing the button would hide and proetct the worksheet however this is not too significant as long as when I close and open the workbook everything is hidden and protected as specified above.
There is no need to password protect anything.
View 9 Replies
View Related
Dec 10, 2006
None of the information Ive found on the forums seem to work in my sheet and Im not sure why. After protecting my sheet/workbook, I would like a particular input of a cell to Unlock another cell.
ie if the contents of cell A1 is the phrase "TRUE", then cell B1 will be Unlocked for editing. If the contents of A1 is "FALSE", then B1 shall remain locked. From what i can tell, this must be carried out using VBA code. If anyone can resolve this issue, Id be also very grateful if you could explain what each line of the code means
View 6 Replies
View Related
Jul 4, 2007
Is it possible to unlock Blank or Empty cells within a Range?
" for example; all cells in the range (A1:F10) > 0 .locked = False "
I have some code from something simmilar i have added below:
Sub test_Click()
Dim rngTemp As Range
For Each rngTemp In Range("grey").Cells
If len(rngtemp.value) > 0 Then
LockMatchedCells rngTemp, Range("against")
endif
Next
End Sub
View 9 Replies
View Related
Jan 19, 2012
Any way to conditionally unlock and unprotect certain cells in a column. I have been unsuccessful with my attempts at customizing other people's vba code that is a little different than what I am trying to achieve. So here's what I would like to accomplish:
If A23 = "Please See DME", then unprotect (pw=richie13) and unlock D23, then protect (pw=richie13) sheet again
If A24 = "Please See DME", then unprotect (pw=richie13) and unlock D24, then protect (pw=richie13) sheet again
If A25 = "Please See DME", then unprotect (pw=richie13) and unlock D25, then protect (pw=richie13) sheet again
and so on and so on.
View 9 Replies
View Related
May 29, 2012
Is there a way to lock and unlock multiple excel spread sheets with only one password at one go? For example if I have 5 sheets, I would like to be able to lock and unlock Sheets 2-5 with one password at one go while leaving sheet 1 unprotected. Do not want to type a pwd for each sheet.
View 9 Replies
View Related
Jan 15, 2014
I want to select the rows that i want to copy then I would like a command button to unlock the sheet using password "2014", copy & paste my selection in the last empty row, and then lock the sheet.
View 9 Replies
View Related
Oct 16, 2009
I have a worksheet that, unless a form for data entry is activated, should be read-only for columns 'A' thru 'M' and 'O' with column 'N' left editable.
The form is activated by a button with a macro assigned to enter the data in the above columns when the form is closed. This has been compiled and works nicely with the sheet unlocked, however, as i need certain columns to be read-only unless the form is activated, i'm stuck with leaving the whole sheet unlocked for editing with or without the form being activated.
Is there any way a VBA code could be used to unlock the worksheet columns that are read-only when the form is activated, and then lock them once the form data is entered to the worksheet and the form closed?
View 9 Replies
View Related