Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Locking Cells

How can I lock cells so that the info can't be changed. (So that they can't
even try if possible)

Also is there a way that if I have

A1 and E3
and the user needs to input data into A1 before they can input data into E3

I want to be able to lock E3 until A1 has info then Unlock E3

But if the user deletes the data in A1 then the data in E3 is also deleted.

How can this be done?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Locking Cells

By default, all of the cells are locked; you only need to protect the
worksheet.

For the cells you don't want locked,
Range("<range_address").Locked = False

Then protect the worksheet,
Worksheets("<worksheet_name").Protect

Look in help for "Protect Method" for a list of parameters you can use with
the Protect method.

To Unprotect the worksheet, and make all cells editable again,
Worksheets("<worksheet_name").UnProtect

To set up a dependency between cells E3 and A1, do something like

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells(3, 5).Locked = (Trim(Cells(1, 1)) = "")
End Sub

"Albert Mulder" wrote in message
...
How can I lock cells so that the info can't be changed. (So that they
can't
even try if possible)

Also is there a way that if I have

A1 and E3
and the user needs to input data into A1 before they can input data into
E3

I want to be able to lock E3 until A1 has info then Unlock E3

But if the user deletes the data in A1 then the data in E3 is also
deleted.

How can this be done?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Locking Cells

Could someone explain this more, I don't get it. Sorry!

To set up a dependency between cells E3 and A1, do something like

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells(3, 5).Locked = (Trim(Cells(1, 1)) = "")
End Sub






"Herrick Andrews" wrote:

By default, all of the cells are locked; you only need to protect the
worksheet.

For the cells you don't want locked,
Range("<range_address").Locked = False

Then protect the worksheet,
Worksheets("<worksheet_name").Protect

Look in help for "Protect Method" for a list of parameters you can use with
the Protect method.

To Unprotect the worksheet, and make all cells editable again,
Worksheets("<worksheet_name").UnProtect

To set up a dependency between cells E3 and A1, do something like

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells(3, 5).Locked = (Trim(Cells(1, 1)) = "")
End Sub

"Albert Mulder" wrote in message
...
How can I lock cells so that the info can't be changed. (So that they
can't
even try if possible)

Also is there a way that if I have

A1 and E3
and the user needs to input data into A1 before they can input data into
E3

I want to be able to lock E3 until A1 has info then Unlock E3

But if the user deletes the data in A1 then the data in E3 is also
deleted.

How can this be done?




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
locking cells rwbaker Excel Discussion (Misc queries) 3 April 27th 10 01:02 PM
Locking everything except cells B4:B8 H New Users to Excel 2 July 6th 09 05:57 PM
locking formula in cells in without locking whole sheet SuziQ Excel Discussion (Misc queries) 1 July 21st 06 03:58 PM
Help on locking cells B Excel Discussion (Misc queries) 1 January 28th 05 04:17 AM
Locking certain cells Marvin Excel Worksheet Functions 1 December 7th 04 07:13 PM


All times are GMT +1. The time now is 06:19 PM.

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"