LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Disable/enable or lock/unlock cells in VBA dependent on other cells values

I have a set of questionnaire form...
if A1="No" then disable/lock B1
if A2="No" then disable/lock B2
etc

if A1 is Yes then you can (enable/unlock) B1 and can accept values etc

can not seem to lock and protect the worksheet to do what I want....
I have been using worksheet change event....

I tried ....
Sheets("xxxx").range("A1:B39").Locked = False
Sheets("xxxx").protect

I then try and set specific cells to be locked = true
i.e
if range("A1")="No" then range("B1").locked = true
else range("B1").locked = False
end if


however this approach is not working....
can you suggest the best way to achieve my goal...
disable/enable or lock/unlock hide/unhide B1 dependent on A1
disable/enable or lock/unlock hide/unhide B2 dependent on A2
 
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/unlock certain cells AJ Excel Programming 0 February 27th 09 02:59 AM
Lock Unlock cells in VBA amit Excel Programming 3 May 12th 08 05:07 PM
Lock/Unlock cells BFife Excel Worksheet Functions 2 October 25th 06 03:20 PM
Lock and Unlock Cells Peter Excel Programming 5 January 29th 05 04:32 PM
Lock and Unlock cells using VBA Peter Excel Discussion (Misc queries) 1 January 29th 05 02:00 PM


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