#1   Report Post  
Posted to microsoft.public.excel.misc
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Leftclick = "x"

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 510
Default Leftclick = "x"

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Leftclick = "x"

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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default Leftclick = "x"

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

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

"Ed" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 510
Default Leftclick = "x"

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



  #6   Report Post  
Posted to microsoft.public.excel.misc
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Leftclick = "x"

Thanks, now it works!

,Ed
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 510
Default Leftclick = "x"

Glad I could help ...
Thanks for the feedback

Carim

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
how do I count only lower case "x" and exclude upper case "X" jbeletz Excel Worksheet Functions 3 October 14th 06 10:50 PM
If "x" Hide / Unhide Rows Ed Excel Discussion (Misc queries) 4 April 18th 06 06:39 PM
Search a random array of cells and return a value of "X" EKB Excel Worksheet Functions 1 April 17th 06 03:57 AM
Duplicate entry "x" number of times gennario Excel Discussion (Misc queries) 1 April 7th 06 11:57 PM
setup a spreadsheet that would enter an "X" when cell is clicked DanW Excel Worksheet Functions 1 February 16th 06 08:21 PM


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