Leftclick = "x"

E

Ed

Hello, I need a macro that when I left-click on any cell within columns B:D I
get a "x" on the cell and if I click again I erase it...

any ideas?

,thanks
 
C

Carim

Hi,

May be with double click ...

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
With Target
If .Cells.Count > 1 Then Exit Sub
If Intersect(.Cells, Me.Range("B:B,D:D")) Is Nothing Then Exit
Sub
If .Value = "" Then
.Value = "X"
Else
.Value = ""
End If
End With
End Sub


HTH
Cheers
Carim
 
E

Ed

Hello Carim,

I tried the code you sent me but it gives me a: "Compile error: Syntax
error", on this part of the code:

If Intersect(.Cells, Me.Range("B:B,D:D")) Is Nothing Then Exit
Sub

What do I need to change?
,thanks
 
P

PCLIVE

If you want to include Column C in your range, then:

If Intersect(.Cells, Me.Range("B:D")) Is Nothing Then Exit Sub
 
C

Carim

Hi Ed,

Since this is an event module, make sure to copy it into the sheet
module,
and, if column C is to be included, change range to "B:D" as indicated
by above contributor.

HTH
Cheers
Carim
 
Top