Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Allow value in only one of two cells

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Allow value in only one of two cells

If Target.Address = "$K$11" Then

the k must be uppercase
--
Gary''s Student - gsnu200751


"CLR" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Allow value in only one of two cells

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

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

Vaya con Dios,
Chuck, CABGx3



"Gary''s Student" wrote:

If Target.Address = "$K$11" Then

the k must be uppercase
--
Gary''s Student - gsnu200751


"CLR" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Allow value in only one of two cells

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



CLR wrote:

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


--

Dave Peterson
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
Excel: match two cells in one sheet to two cells in another and return a third cells value Spence Excel Worksheet Functions 3 February 13th 11 05:33 AM
compare 2 column cells and return the adjacent columns cells data of the cell trebor57 Excel Worksheet Functions 1 February 1st 11 02:54 PM
join data in multiple cells when adjoining cells match criteria ?? angiec50 Excel Worksheet Functions 1 October 6th 09 10:27 AM
display a range of cells editible cells based on matching date Miki Excel Worksheet Functions 0 October 10th 07 03:27 PM
Skip cells with TAB/SHIFT+TAB but allow arrow keys/mouse selection of skipped cells Wescotte Excel Programming 1 June 6th 05 07:00 PM


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