View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dkline Dkline is offline
external usenet poster
 
Posts: 75
Default Repost of Question on Preventing 2 cells from having the same

So it was simple as making the Target.Address an absolute?!

I need a proverbial smack upside the head. I say so because I had already
specified a couple of target.addesses in code that preceded this portion of
the code.

"Jay" wrote:

Hi Dkline -

If Target.Address = "$B$6" Then
If Range("B6").Value = "Y" Then
Range("B7").Value = "N"
MsgBox "If Interest is in Arrears, you cannot Defer Interest."
End If
End If
If Target.Address = "$B$7" Then
If Range("B7").Value = "Y" Then
Range("B6").Value = "N"
MsgBox "If Interest is being Deferred, you cannot pay interest in arrears."
End If
End If

---
Jay


"Dkline" wrote:

I had posted this question last week. JLGWhiz kindly posted a solution but I
cannot get it to work 100% of the time. So I am making another appeal for
help.

My original post was:
I have two cells which can be either "Y" or "N". Both have list dropdowns
which are limited to Y or N and field cannot be left blank.

These two fields are mutually exclusive to the extent that both cannot be
"Y". They both can be "N".

If the cell "B6" is set to "Y", the cell "B7" must be set to "N". If the end
user then changes "B7" to "Y", then "B6" must be set to "N".

Below is my code in the Worksheet "Inputs".

If Target.Address = Range("B6") Then
If Range("B6").Value = "Y" Then
Range("B7").Value = "N"
MsgBox "If Interest is in Arrears, you cannot Defer Interest."
End If
End If
If Target.Address = Range("B7") Then
If Range("B7").Value = "Y" Then
Range("B6").Value = "N"
MsgBox "If Interest is being Deferred, you cannot pay interest in arrears."
End If
End If