Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
FVC
 
Posts: n/a
Default "Check Marking" a cell

Can I format (via Macro???) a cell so that if the user left clicks on the
cell a check mark appears without using the Control Toolbox. The cells with
such format will only need to then be the totaled (via =counta(x:x).
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

There's no left click you can tie into. You could base it on selection (either
the mouse or the keyboard), but you could use rightclick for this:

If that's ok, rightclick on the worksheet tab that should have this behavior.
Select view code and paste this into that code window:

Option Explicit
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("a:a")) Is Nothing Then
Exit Sub
End If

With Target
If IsEmpty(.Value) Then
.Value = Chr(252)
.Font.Name = "Wingdings"
Else
.ClearContents
End If
End With
Cancel = True
End Sub

I used column A (range("a:a")), but you could specify any cells you wanted:

me.range("a1:b3,d9:f12,c:c")
for example.

FVC wrote:

Can I format (via Macro???) a cell so that if the user left clicks on the
cell a check mark appears without using the Control Toolbox. The cells with
such format will only need to then be the totaled (via =counta(x:x).


--

Dave Peterson
  #3   Report Post  
David
 
Posts: n/a
Default

?B?RlZD?= wrote

Can I format (via Macro???) a cell so that if the user left clicks on
the cell a check mark appears without using the Control Toolbox. The
cells with such format will only need to then be the totaled (via
=counta(x:x).

Something like this in a WorkSheet module:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Target.Count 1 Then Exit Sub
With Selection
..Value = Chr(252): .Font.Name = "Wingdings"
End With
End Sub


--
David
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
Cell addressing using the content of another cell. De Jandon Excel Worksheet Functions 5 April 1st 05 10:59 PM
Cell addressing using the content of another cell. Jandon Excel Worksheet Functions 1 March 30th 05 06:39 PM
How do I make a cell equal to another cells value and not it's fo. TroutKing Excel Worksheet Functions 2 January 17th 05 06:15 PM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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