View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
-JEFF-[_2_] -JEFF-[_2_] is offline
external usenet poster
 
Posts: 26
Default On click question?

Mr. Ogilvy,
A different Jeff here. I have been unable to get this to work on a cell
that has been merged. Would you please test that and see if that is the
case? If so, is there a fix? Thanks! -JEFF-

"Tom Ogilvy" wrote:

See fixed typo:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
if Target.count 1 then exit sub
if not Intersect(target,Range("B3:G99")) is nothing then
Target.Value = "x"
End if
End Sub


if you want to toggle the x

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
if Target.count 1 then exit sub
if not Intersect(target,Range("B3:G99")) is nothing then
if isempty(Target.Value) then
Target.Value = "x"
else
Target.clearContents
End if
End if
End Sub

--
Regards,
Tom Ogilvy

"Jeff" wrote in message
...
I get a syntax error on the intersect. Any idea why?

"Tom Ogilvy" wrote:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
if Target.count 1 then exit sub
if not Intersect(target,Range("B3:G99") is nothing then
Target.Value = "x"
End if
End Sub


if you want to toggle the x

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
if Target.count 1 then exit sub
if not Intersect(target,Range("B3:G99") is nothing then
if isempty(Target.Value) then
Target.Value = "x"
else
Target.clearContents
End if
End if
End Sub

--
Regards,
Tom Ogilvy

"Jeff" wrote in message
...
Is there a way to add an x in a when you click in a cell in a range

like
B3:G99 only and not the whole sheet? Right now I can do it to the

whole
sheet
with
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveCell.Value = "x"
End Sub
Thanks!