Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Lock a Cell or Row


Hi Guys,

I want to lock a cell or row so that the user of the spreadseet won't
be able to edit the contents of the cell or row.

Any help would be greatly appreciated,

Aidan


--
afmullane
------------------------------------------------------------------------
afmullane's Profile: http://www.excelforum.com/member.php...o&userid=33567
View this thread: http://www.excelforum.com/showthread...hreadid=538431

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Lock a Cell or Row

select the cells/rows/ranges

format=Cells=Protection Tab, click Locked

then
Tools=Protect sheet

--
Regards,
Tom Ogilvy


"afmullane" wrote:


Hi Guys,

I want to lock a cell or row so that the user of the spreadseet won't
be able to edit the contents of the cell or row.

Any help would be greatly appreciated,

Aidan


--
afmullane
------------------------------------------------------------------------
afmullane's Profile: http://www.excelforum.com/member.php...o&userid=33567
View this thread: http://www.excelforum.com/showthread...hreadid=538431


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Lock a Cell or Row

I should add that all cells by default are Locked. this is not applied
until the sheet is protected - so in practicality, you need to select the
cells you want the user to have access to and do

format=Cells=Protection tab and click unlocked. Then protect the sheet.

--
Regards,
Tom Ogilvy


"afmullane" wrote:


Hi Guys,

I want to lock a cell or row so that the user of the spreadseet won't
be able to edit the contents of the cell or row.

Any help would be greatly appreciated,

Aidan


--
afmullane
------------------------------------------------------------------------
afmullane's Profile: http://www.excelforum.com/member.php...o&userid=33567
View this thread: http://www.excelforum.com/showthread...hreadid=538431


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Lock a Cell or Row


Hi Tom,

Thanks for your help Tom but do you know of a way of locking a cel
from the user but that the cell can still be manipulated through VB
code??

Aida

--
afmullan
-----------------------------------------------------------------------
afmullane's Profile: http://www.excelforum.com/member.php...fo&userid=3356
View this thread: http://www.excelforum.com/showthread.php?threadid=53843

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Lock a Cell or Row

One way is to just have your code unprotect the sheet, do its changes and
reprotect the sheet.

with worksheets("sheet99")
.unprotect password:="hithere"
'do the work
.protect password:="hithere"
end with

An alternative is to protect the sheet in code.

Option Explicit
Sub auto_open()
With Worksheets("sheet99")
.Protect Password:="hithere", userinterfaceonly:=True
End With
End Sub

It needs to be reset each time you open the workbook. (excel doesn't remember
it after closing the workbook.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

There are a few things that your macro won't be able to do--so test your code
before you distribute the workbook.

afmullane wrote:

Hi Tom,

Thanks for your help Tom but do you know of a way of locking a cell
from the user but that the cell can still be manipulated through VBA
code??

Aidan

--
afmullane
------------------------------------------------------------------------
afmullane's Profile: http://www.excelforum.com/member.php...o&userid=33567
View this thread: http://www.excelforum.com/showthread...hreadid=538431


--

Dave Peterson
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
How to lock the Ctrl key? (as locking the Shift key w/Caps Lock) Rick-cel Excel Discussion (Misc queries) 2 August 5th 09 06:45 PM
how do I undo the scroll lock, thscroll lock button does not work scroll lock Excel Discussion (Misc queries) 3 July 19th 08 10:17 PM
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 2 January 21st 07 10:59 PM
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 1 January 21st 07 09:44 AM
Lock data in a cell a specific cell based on selection on other ce CrimsonPlague29 Excel Worksheet Functions 0 May 10th 06 11:06 AM


All times are GMT +1. The time now is 03:11 PM.

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

About Us

"It's about Microsoft Excel"