Solved

Unlocking specific cells in an Xcel locked worksheet.

Posted on 2013-01-22
8
355 Views
Last Modified: 2013-02-24
I write VB Xcel programs for local organizations - the purpose is to create summary reports from database worksheets.  Saves the organization mucho time.

I also need to have the summary report worksheet locked so the organization workers do not change the structure of the summary report which would display data in the wrong cells.

My problem is that I also need to have some of the cells in the locked summary report worksheet not locked.  The purpose is to have the user select the worksheet used by VB, ie,  current year or previous year database worksheet for example.

When entering VB sub I unlock the worksheet with:  ActiveSheet.Unprotect

And when exiting the sub: ActiveSheet.Protect.

Need to keep the user needed data entry cells unlocked.

Any help would greatly appreciated.

AcDcRed
0
Comment
Question by:AcDcRed
  • 4
  • 3
8 Comments
 
LVL 26

Expert Comment

by:redmondb
ID: 38807333
Hi, AcDcRed.

In the attached, Sheet1 is locked, but the user can change the yellow cells as their Locked gflag has been set off.

To unlock a cell, right click, select "Format cells...", select the "Protection" Tab, untick "Locked".

(The flag only has effect when the the sheet itself is protected.)

Regards,
Brian.Locked.xls
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 100 total points
ID: 38807372
And from VBA, while the worksheet is unprotected, set the appropriate value (True or False) for the Locked property for the range objects representing your data entry cells.
0
 

Author Closing Comment

by:AcDcRed
ID: 38807667
Both solutions basically were the same only worked differently.  They were sufficient to allow me to accomplish my end.

Thanks,

AcDcRed
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38807808
AcDcRed,

I understand that this was not an important matter for you, but it would be a good learning for us to know why the answers were deficient.

Thanks,
Brian.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:AcDcRed
ID: 38807877
Brian,

The answers were not deficient only worded (not worked) different.  One term that I did not know was "gflag".  But your explanation following the use of that term was what I needed;

Format Cells / Protection tab / Locked

Regards,

AcDcRed

.
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38808020
Thanks, AcDcRed.

I've just noticed that you're a new member - a belated welcome!

While the points allocated to a Question are simply a measure of its importance to you, the Grade is more objective.

Unless there's some shortfall in the answer, Grade A is the norm. On the other hand, if you feel that a lower Grade is appropriate then please give a brief explanation to help improve future answers.

(BTW, "gflag" sounds fascinating but it's simply a typo for "flag"!)

Regards,
Brian.
0
 

Author Comment

by:AcDcRed
ID: 38808057
Brian,

Thanks for the advice - will keep it in mind when I enter another question.

Thanks also for making an new menber welcome.

Regards,

AcDcRed
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38808099
All the best, AcDcRed!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now