View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default On Click Event?, and how to use

1, insert this line as the FIRST line in the macro
on error resume next
2. The only way to change a cell without selecting is to pre-define it
range("a3").value="X"



--
Don Guillett
SalesAid Software

"thanks and more" wrote in message
...
Thanks guys, to both of you. Now further on the same
problem. First, the macro will error if you accidentally
select more than one cell. My project entails dummy
proofing the thing. Is there away to allow you to only
select one cell, or is there a way to make it swich the
multiple cells all at once (that would be really cool).
Second, I guess I would also prefer that it not actually
select the cell but just change it. Even some way to
insert something like:
returnto = ActiveWindow.RangeSelection.Address
Range(returnto).Select
would be good, but this particualar event calls out after
the cell(s) is/are already selected. Thanks again. Hope
you can help.
-----Original Message-----
In the module for the worksheet in question, use the
Worksheet_SelectionChange event. Here is an example of

how that can be
accomplished.

Private Sub Worksheet_SelectionChange(ByVal Target As

Range)
If Target.Row = 3 And Target.Column = 3 Then
If Target.Value < "" Then
Target.Value = ""
Else
Target.Value = "X"
End If
End If
End Sub

Pikus


---
Message posted from
http://www.ExcelForum.com/

.