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


Hi Folks,

I have a worksheet that has got 2 Columns, A and B. Both Columns hav
validation list with values YES and No, My query is that for example i
on cell A10 if i choose Value YES from Validation drop down list the
the cell B10 should automatically Show No and should be locked fo
protection and no changes be made to cell B10. But if i select No i
A10 then B10 should show YEs and now A10 should be locked.

I have been trying trying and trying but its not happening, Please hel
me on this.

Regards,


Tahi

--
tahi

Student, working on a projec
-----------------------------------------------------------------------
tahir's Profile: http://www.excelforum.com/member.php...nfo&userid=605
View this thread: http://www.excelforum.com/showthread.php?threadid=52301

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Locking Cells on Validation

That cannot be done through Data, Validation alone since it only affects the
current cell. A better design is to use a worksheet change event macro to
make the cells in A and B the opposite whenever one changes. Forget about
the locking bit; totally unnecessary.

--
Jim
"tahir" wrote in
message ...
|
| Hi Folks,
|
| I have a worksheet that has got 2 Columns, A and B. Both Columns have
| validation list with values YES and No, My query is that for example if
| on cell A10 if i choose Value YES from Validation drop down list then
| the cell B10 should automatically Show No and should be locked for
| protection and no changes be made to cell B10. But if i select No in
| A10 then B10 should show YEs and now A10 should be locked.
|
| I have been trying trying and trying but its not happening, Please help
| me on this.
|
| Regards,
|
|
| Tahir
|
|
| --
| tahir
|
| Student, working on a project
| ------------------------------------------------------------------------
| tahir's Profile:
http://www.excelforum.com/member.php...fo&userid=6053
| View this thread: http://www.excelforum.com/showthread...hreadid=523016
|


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


Jim Rech Wrote:
That cannot be done through Data, Validation alone since it only affect
the
current cell. A better design is to use a worksheet change event macr
to
make the cells in A and B the opposite whenever one changes. Forge
about
the locking bit; totally unnecessary.

--
Jim
"tahir" wrote in
message ...
|
| Hi Folks,
|
| I have a worksheet that has got 2 Columns, A and B. Both Column
have
| validation list with values YES and No, My query is that for exampl
if
| on cell A10 if i choose Value YES from Validation drop down lis
then
| the cell B10 should automatically Show No and should be locked for
| protection and no changes be made to cell B10. But if i select No in
| A10 then B10 should show YEs and now A10 should be locked.
|
| I have been trying trying and trying but its not happening, Pleas
help
| me on this.
|
| Regards,
|
|
| Tahir
|
|
| --
| tahir
|
| Student, working on a project

------------------------------------------------------------------------
| tahir's Profile:
http://www.excelforum.com/member.php...fo&userid=6053
| View this thread
http://www.excelforum.com/showthread...hreadid=523016
|


This is the code of Worksheet Change, This code works great, but it ha
limitations. The code only triggers on Cell B3 for change. Is i
possible to expand it to a range of A1 to L60

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$3" Then
Application.EnableEvents = False
If Target.Value = "Yes" Then
With Range("C3")
.Value = "No"
With .Validation
.Delete
.Add Type:=xlValidateTextLength, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlEqual, Formula1:="0"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = "Leave cell blank"
.ShowInput = False
.ShowError = True
End With
End With
Else
With Range("C3")
.Value = "Yes"
With .Validation
.Delete
.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlEqual, Formula1:="=Eligible"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = "Select from the list"
.ShowInput = False
.ShowError = True
End With
End With
End If
End If
Application.EnableEvents = True
End Su

--
tahi

Student, working on a projec
-----------------------------------------------------------------------
tahir's Profile: http://www.excelforum.com/member.php...nfo&userid=605
View this thread: http://www.excelforum.com/showthread.php?threadid=52301

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 Cell through Validation Premanand Sethuraman Excel Worksheet Functions 3 July 18th 08 03:43 PM
Locking Data Validation Drop Down Joe D Excel Discussion (Misc queries) 0 June 12th 08 02:34 PM
Locking cells P. Zicari Excel Worksheet Functions 1 October 24th 07 11:42 PM
Locking non-Validation cells in ranges Sandy Excel Worksheet Functions 1 September 1st 07 08:46 PM
locking formula in cells in without locking whole sheet SuziQ Excel Discussion (Misc queries) 1 July 21st 06 03:58 PM


All times are GMT +1. The time now is 08:56 AM.

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"