Allow value in only one of two cells

G

Guest

Hi All........

Having trouble here trying to build a toggle to allow an entry in only one
of two cells.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Address = "$K$10" Then
Range("k11").Value = ""
Range("K10").Value = "CRA"
Else
End If
If Target.Address = "$k$11" Then
Range("k10").Value = ""
Range("K11").Value = "CRA"
Else
End If
End Sub

The first IF works fine, the second one don't work at all.

Any help would be appreciated.

TIA
Vaya con Dios,
Chuck, CABGx3
 
G

Guest

" Oh for crying out loud!".............

Thank you kind Sir.........

Vaya con Dios,
Chuck, CABGx3
 
D

Dave Peterson

I like this style to avoid that problem:
If not (intersect(Target, me.range("k10")) is nothing) then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top