Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default How do I lock worksheets so only a couple ranges on each allow inp

I have several worksheets w/ fields that display information and allow user
input in a couple of areas on each sheet. Each as macro buttons the user
pushes after his input to update another database worksheet. How do I lock
the entire db worksheet and all columns on the other sheets except the ranges
user input is allowed. The macros need to be able to update data in the
locked areas of any sheet.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I lock worksheets so only a couple ranges on each allow inp


John Wrote:
I have several worksheets w/ fields that display information and allow
user
input in a couple of areas on each sheet. Each as macro buttons the
user
pushes after his input to update another database worksheet. How do I
lock
the entire db worksheet and all columns on the other sheets except the
ranges
user input is allowed. The macros need to be able to update data in
the
locked areas of any sheet.


You could unlock all the cells in the range manually while designing
your sheets( Format Cellprotectionlock untick) to which you want user
to have access ( or you can unlock the range through a procedure ) and
then protect all the sheets. Unprotect the sheets in your procedure
before you want to write data to protected area and protect it again
after you finish writing data.
Say I have a table of 10 rows and 2 cols (A1:B10). I want to give
access to users to col A but not B. After entering data in A, user
clicks a button and then the macro displays calculated results in B.
I would have initialising statements
Range(cells(1,1),cells(10,1).locked=false
Sheets("sheet 1").Protect Password="abcd"
This will allow user access to col A 10 rows, but nowhere on the
sheet.

My macro could be something like
Sheets("sheet1").Unprotect Password="abcd"
[B1]=..
[B2]=..
etc
Sheets("sheet1").Protect Password="abcd"
What I am doing is unprotecting the sheet just before I want to update
col B and then protecting it again.


--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=503151

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide/lock worksheets McChas Excel Worksheet Functions 4 January 7th 10 05:50 PM
how do I lock the first tab of multiple worksheets cailasgramma Excel Worksheet Functions 1 September 16th 08 04:52 PM
How do I lock some of the worksheets in an excel 07 spreadsheet John Excel Worksheet Functions 2 December 20th 07 02:02 PM
A couple of questiosn on Named Ranges Simon Cleal Excel Discussion (Misc queries) 5 September 5th 06 09:25 AM
How can I lock worksheets while macros can still enter into them? enginguven Excel Discussion (Misc queries) 3 January 12th 06 12:56 AM


All times are GMT +1. The time now is 11:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"