Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro To Lock Certain Cells... Please Help


Hi,

Scenario:
I am working on a sheet that has a column G and Colum H, Column
contains validated list containing values "Yes" and "No", When i choos
"Yes" from any cell in G column the value in the H column adjacent cel
turns to "No", but if i choose "No" from column G the value in H colum
turns "Yes".

Problem:
My problem is related to locking the cell that have a value of "No"
means as soon as the value "No" gets into any cell in Column H th
related cell should be locked for editing. Simply any cell in G or H i
has "No" must be locked. else Open for editing.

Hope Someone will Help,

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=52365

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro To Lock Certain Cells... Please Help


tahir Wrote:
Hi,

Scenario:
I am working on a sheet that has a column G and Colum H, Column
contains validated list containing values "Yes" and "No", When i choos
"Yes" from any cell in G column the value in the H column adjacent cel
turns to "No", but if i choose "No" from column G the value in H colum
turns "Yes".

Problem:
My problem is related to locking the cell that have a value of "No"
means as soon as the value "No" gets into any cell in Column H th
related cell should be locked for editing. Simply any cell in G or H i
has "No" must be locked. else Open for editing.

Currently i m using this code but it do not have locking or protectin
the cells that contain "No" Value.

********Start of Code********
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
If Intersect(Target, Range("G2:G60", "k2:k60")) Is Nothing Then Exi
Sub
Application.EnableEvents = False
If Target.Value = "Yes" Then
Target.Offset(0, 1).Value = "No"
Else
If Target.Value = "No" Then
Target.Offset(0, 1).Value = "Yes"
Else
Target.Offset(0, 1).Value = ""
Application.EnableEvents = False
If Target.Value = "New" Then
Target.Offset(0, 1).Value = "Old"
Else
If Target.Value = "Old" Then
Target.Offset(0, 1).Value = "New"
Else
Target.Offset(0, 1).Value = ""
End If
End If
End If
End If
Application.EnableEvents = True
End Sub
********End of Code********

Hope Someone will Help,

Regards,

Tahir



Please Help Me on this , I m really stuck, This is my third day bu
cant figure out how to lock the cells on selection of values from othe
cell

--
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=52365

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro To Lock Certain Cells... Please Help


tahir Wrote:
Hi,

Scenario:
I am working on a sheet that has a column G and Colum H, Column
contains validated list containing values "Yes" and "No", When i choos
"Yes" from any cell in G column the value in the H column adjacent cel
turns to "No", but if i choose "No" from column G the value in H colum
turns "Yes".

Problem:
My problem is related to locking the cell that have a value of "No"
means as soon as the value "No" gets into any cell in Column H th
related cell should be locked for editing. Simply any cell in G or H i
has "No" must be locked. else Open for editing.

Currently i m using this code but it do not have locking or protectin
the cells that contain "No" Value.

********Start of Code********
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
If Intersect(Target, Range("G2:G60", "k2:k60")) Is Nothing Then Exi
Sub
Application.EnableEvents = False
If Target.Value = "Yes" Then
Target.Offset(0, 1).Value = "No"
Else
If Target.Value = "No" Then
Target.Offset(0, 1).Value = "Yes"
Else
Target.Offset(0, 1).Value = ""
Application.EnableEvents = False
If Target.Value = "New" Then
Target.Offset(0, 1).Value = "Old"
Else
If Target.Value = "Old" Then
Target.Offset(0, 1).Value = "New"
Else
Target.Offset(0, 1).Value = ""
End If
End If
End If
End If
Application.EnableEvents = True
End Sub
********End of Code********

Hope Someone will Help,

Regards,

Tahir



Please Help Me on this , I m really stuck, This is my third day bu
cant figure out how to lock the cells on selection of values from othe
cell

--
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=52365

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro To Lock Certain Cells... Please Help


tahir Wrote:
Hi,

Scenario:
I am working on a sheet that has a column G and Colum H, Column
contains validated list containing values "Yes" and "No", When i choos
"Yes" from any cell in G column the value in the H column adjacent cel
turns to "No", but if i choose "No" from column G the value in H colum
turns "Yes".

Problem:
My problem is related to locking the cell that have a value of "No"
means as soon as the value "No" gets into any cell in Column H th
related cell should be locked for editing. Simply any cell in G or H i
has "No" must be locked. else Open for editing.

Currently i m using this code but it do not have locking or protectin
the cells that contain "No" Value.

********Start of Code********
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
If Intersect(Target, Range("G2:G60", "k2:k60")) Is Nothing Then Exi
Sub
Application.EnableEvents = False
If Target.Value = "Yes" Then
Target.Offset(0, 1).Value = "No"
Else
If Target.Value = "No" Then
Target.Offset(0, 1).Value = "Yes"
Else
Target.Offset(0, 1).Value = ""
Application.EnableEvents = False
If Target.Value = "New" Then
Target.Offset(0, 1).Value = "Old"
Else
If Target.Value = "Old" Then
Target.Offset(0, 1).Value = "New"
Else
Target.Offset(0, 1).Value = ""
End If
End If
End If
End If
Application.EnableEvents = True
End Sub
********End of Code********

Hope Someone will Help,

Regards,

Tahir



Please Help Me on this , I m really stuck, This is my third day bu
cant figure out how to lock the cells on selection of values from othe
cell

--
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=52365

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro To Lock Certain Cells... Please Help


tahir Wrote:
Hi,

Scenario:
I am working on a sheet that has a column G and Colum H, Column
contains validated list containing values "Yes" and "No", When i choos
"Yes" from any cell in G column the value in the H column adjacent cel
turns to "No", but if i choose "No" from column G the value in H colum
turns "Yes".

Problem:
My problem is related to locking the cell that have a value of "No"
means as soon as the value "No" gets into any cell in Column H th
related cell should be locked for editing. Simply any cell in G or H i
has "No" must be locked. else Open for editing.

Currently i m using this code but it do not have locking or protectin
the cells that contain "No" Value.

********Start of Code********
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
If Intersect(Target, Range("G2:G60", "k2:k60")) Is Nothing Then Exi
Sub
Application.EnableEvents = False
If Target.Value = "Yes" Then
Target.Offset(0, 1).Value = "No"
Else
If Target.Value = "No" Then
Target.Offset(0, 1).Value = "Yes"
Else
Target.Offset(0, 1).Value = ""
Application.EnableEvents = False
If Target.Value = "New" Then
Target.Offset(0, 1).Value = "Old"
Else
If Target.Value = "Old" Then
Target.Offset(0, 1).Value = "New"
Else
Target.Offset(0, 1).Value = ""
End If
End If
End If
End If
Application.EnableEvents = True
End Sub
********End of Code********

Hope Someone will Help,

Regards,

Tahir



Please Help Me on this , I m really stuck, This is my third day bu
cant figure out how to lock the cells on selection of values from othe
cell

--
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=52365



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro To Lock Certain Cells... Please Help


tahir Wrote:
Hi,

Scenario:
I am working on a sheet that has a column G and Colum H, Column
contains validated list containing values "Yes" and "No", When i choos
"Yes" from any cell in G column the value in the H column adjacent cel
turns to "No", but if i choose "No" from column G the value in H colum
turns "Yes".

Problem:
My problem is related to locking the cell that have a value of "No"
means as soon as the value "No" gets into any cell in Column H th
related cell should be locked for editing. Simply any cell in G or H i
has "No" must be locked. else Open for editing.

Currently i m using this code but it do not have locking or protectin
the cells that contain "No" Value.

********Start of Code********
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
If Intersect(Target, Range("G2:G60", "k2:k60")) Is Nothing Then Exi
Sub
Application.EnableEvents = False
If Target.Value = "Yes" Then
Target.Offset(0, 1).Value = "No"
Else
If Target.Value = "No" Then
Target.Offset(0, 1).Value = "Yes"
Else
Target.Offset(0, 1).Value = ""
Application.EnableEvents = False
If Target.Value = "New" Then
Target.Offset(0, 1).Value = "Old"
Else
If Target.Value = "Old" Then
Target.Offset(0, 1).Value = "New"
Else
Target.Offset(0, 1).Value = ""
End If
End If
End If
End If
Application.EnableEvents = True
End Sub
********End of Code********

Hope Someone will Help,

Regards,

Tahir



Please Help Me on this , I m really stuck, This is my third day bu
cant figure out how to lock the cells on selection of values from othe
cell

--
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=52365

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro To Lock Certain Cells... Please Help


Please Its Really Getting Hard for me, Please Hel

--
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=52365

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 unlock and lock cells in password protected sheet Chris Excel Discussion (Misc queries) 3 February 26th 10 09:06 PM
Macro / Programming to lock cells Neil Holden Excel Discussion (Misc queries) 1 August 5th 09 01:21 PM
lock cells [email protected] New Users to Excel 3 February 22nd 08 02:07 PM
How do I lock all cells in a given row together to one another? Michael Goldman Excel Discussion (Misc queries) 1 May 27th 06 08:17 AM
how can I lock certain cells? Linds Excel Discussion (Misc queries) 2 December 20th 05 10:46 PM


All times are GMT +1. The time now is 05:26 AM.

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"