Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SU
 
Posts: n/a
Default Disable a range of Cells

How can I disable a range of cells only for them to become active depending
on the value of another specific cell? I don't want the cells to accept any
input data unless it meets the criteria specified on another cell. For
instance, on the 29th day of February.

Many thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron de Bruin
 
Posts: n/a
Default Disable a range of Cells

Hi SU

This example unlock the cells A5:C10 if cell A1 = "ron"
(Unlock cell A1 also before you try it)

It unprotect/protect the sheet without a password this example but you can add a password if you want


'Place the code in the Sheet module
'
'Right click on a sheet tab and choose view code
'Paste the code there
'Alt-Q to go back to Excel


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A1"), Target) Is Nothing Then
If Target.Value = "ron" Then
Me.Unprotect
Range("A5:C10").Locked = False
Me.Protect
Else
Me.Unprotect
Range("A5:C10").Locked = True
Me.Protect
End If
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"SU" wrote in message ...
How can I disable a range of cells only for them to become active depending
on the value of another specific cell? I don't want the cells to accept any
input data unless it meets the criteria specified on another cell. For
instance, on the 29th day of February.

Many thanks.



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
Macro to hide blank cells in a range Dave Excel Discussion (Misc queries) 1 February 1st 06 11:55 PM
Display first, second, etc Nonblank Cells in a Range Jeremy N. Excel Worksheet Functions 12 September 25th 05 01:47 PM
Counting empty cells within a range of cells Rosehill - ExcelForums.com New Users to Excel 2 May 2nd 05 08:53 AM
Counting empty cells within a range of cells Rosehill - ExcelForums.com New Users to Excel 0 April 7th 05 12:47 AM
Count cells in one range based on parameters in another range dave roth Excel Worksheet Functions 2 March 29th 05 05:33 PM


All times are GMT +1. The time now is 11:04 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"