Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I set a specific excel cell to enter an 'X' when clicked

Another issue to finalize my format for building an automatted test form.
Can I identify a specific excel cell, where if 'clicked', will enter an 'X',
if 'clicked again' will remove any existing 'x'?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Can I set a specific excel cell to enter an 'X' when clicked

I'd recommend using a double-click event rather than a single-click
(selection), since selection also fires when the cell is tabbed or
arrowed into.

Put this in your worksheet code module:

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
With Target
If Not Intersect(.Cells, Range("B1:B10")) Is Nothing Then
Cancel = True
If IsEmpty(.Value) Then
.Value = "X"
Else
.ClearContents
End If
End If
End With
End Sub

Change the range ("B1:B10") to suit.

OTOH, you could also use a checkbox from the Forms toolbar and link it
to a cell.


In article ,
Test Creator <Test wrote:

Another issue to finalize my format for building an automatted test form.
Can I identify a specific excel cell, where if 'clicked', will enter an 'X',
if 'clicked again' will remove any existing 'x'?

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
enter time when shape is clicked Dgwood90 Excel Discussion (Misc queries) 1 October 15th 08 10:31 AM
insert a row with enter on a specific cell Oakie Excel Discussion (Misc queries) 4 July 28th 06 05:22 PM
setup a spreadsheet that would enter an "X" when cell is clicked DanW Excel Worksheet Functions 1 February 16th 06 08:21 PM
How to auto-enter date when cell is clicked? Ron M. Excel Discussion (Misc queries) 4 October 22nd 05 08:32 PM
How do I set the Enter key to go to a specific cell? John Excel Discussion (Misc queries) 2 March 18th 05 11:51 PM


All times are GMT +1. The time now is 10:26 PM.

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"