+ Reply to Thread
Results 1 to 3 of 3

Thread: Clicking in a Cell

  1. #1
    Registered User
    Join Date
    03-03-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Clicking in a Cell

    Hi,

    I'm facing this problem since two days. Like we have Application.DoubleClick to double click on ActiveCell, is there a way to perform a single click on the cell?

    I want this to do because i have checkboxes embedded in each cell in excel sheet and want to check or uncheck them based certain condition.

    I tried to use checkbox control methods, but not successful as the checkbox is not getting identified.

    Please let me know if anyone has come across this kind of issue and what you did to overcome it.

    Thanks,
    Vidya

  2. #2
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    537

    Re: Clicking in a Cell

    checkboxes return a true or false

    Attach a dummy workbook where you need checkboxes, might could get it going for you...if not too difficult
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  3. #3
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,300

    Re: Clicking in a Cell

    Hi Vidya and welcome to the forum.

    I've found check boxes are way too much overhead for what you get. Find the attached where a double click anywhere in column A will add an X or remove the X in any row.

    See the code behind Sheet1 to see what is happening and use it for your own workbooks.
    The code looks like:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Target.Column <> 1 Then GoTo Ender
        If Target.Row = 1 Then GoTo Ender
        If Target = "x" Then
                Target = ""
        GoTo Ender
        End If
        If Target = "" Then
                Target = "x"
        End If
    Ender:
        Cancel = True
    End Sub
    You can then check for an x in the cell instead of dealing with checkboxes.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0