+ Reply to Thread
Results 1 to 8 of 8

code so that when a cell is clicked, a tick mark goes in the cell that was clicked

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    46

    code so that when a cell is clicked, a tick mark goes in the cell that was clicked

    Hey there

    I need code so that when a cell is clicked, a tick mark goes in the cell that was clicked. This could include a dash, checkmark, dot and etc. I also want it so that if a cell that is already ticked is clicked, its tick gets removed. I want this to apply to all cells except the first row (1) and first column (A). I am not good with programming so if you provide the code, can you tell me where to place it?

    Thanks in advance

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: code so that when a cell is clicked, a tick mark goes in the cell that was clicked

    benham,

    Give this a try:
    Please Login or Register  to view this content.

    To place the code, right click on the sheet you want to monitor for cell clicks, and select "View Code", then copy/paste the code into there.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: code so that when a cell is clicked, a tick mark goes in the cell that was clicked

    Copy this code and paste it into the worksheet module:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Last edited by Ron Coderre; 08-08-2013 at 11:54 AM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    06-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: code so that when a cell is clicked, a tick mark goes in the cell that was clicked

    Hey tiger

    I tried your code and it worked perfectly. Just one thing. When i click on a cell and "#" appears, i need to click on another cell in order to click on the previous cell and remove the "#". Is there a way to make the double click work.

    Thanks

  5. #5
    Registered User
    Join Date
    06-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: code so that when a cell is clicked, a tick mark goes in the cell that was clicked

    Hey tiger

    I tried your code and it worked perfectly. Just one thing. When i click on a cell and "#" appears, i need to click on another cell in order to click on the previous cell and remove the "#". Is there a way to make the double click work.

    Thanks

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: code so that when a cell is clicked, a tick mark goes in the cell that was clicked

    behnam,

    You could call the SelectionChange event from the BeforeDoubleClick event:
    Please Login or Register  to view this content.
    So after you click on a cell, you can double-click it to toggle

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: code so that when a cell is clicked, a tick mark goes in the cell that was clicked

    If you check the code I posted, it actually selects the cell to the right of the tick-mark cell after setting its value. That way each click on the cell toggles its value.

  8. #8
    Registered User
    Join Date
    06-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: code so that when a cell is clicked, a tick mark goes in the cell that was clicked

    Thanks guys this worked perfectly

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. tab disappears when left clicked or right clicked
    By HP RodNuclear in forum Excel General
    Replies: 2
    Last Post: 03-14-2011, 02:27 PM
  2. Getting the clicked cell
    By Vaclav in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2010, 12:50 PM
  3. Code to say "if the selected cell is within a range and is double clicked"...
    By diputz42 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2010, 10:16 PM
  4. Replies: 6
    Last Post: 01-08-2006, 06:20 PM
  5. Change cell value when right-clicked/double-clicked
    By grime in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2005, 09:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1