+ Reply to Thread
Results 1 to 5 of 5

Click Shape to return TRUE value, Double Click to return FALSE value

  1. #1
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    Click Shape to return TRUE value, Double Click to return FALSE value

    I am looking to click a shape and return a TRUE value in different cell. When I click the shape for a second time I am looking to return a FALSE value. (I tried a checkbox and they stacked when they were hidden). I can get the TRUE value for one click. However, I am unsure to add in the second click or double click option. Any help is greatly appreciated

    Sub Info1_Click()
    Application.ScreenUpdating = False
    Range("D5").Value = "TRUE"
    Application.ScreenUpdating = True
    End Sub

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Click Shape to return TRUE value, Double Click to return FALSE value

    Nice little snippet.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    Re: Click Shape to return TRUE value, Double Click to return FALSE value

    Thanks for this. Sorry but I am new to VBA and I have no idea what to put in after Dim. What should be substituted for the X?
    I have tried this but it doesn't like it.

    Sorry if this is an daft question.

    Sub Tick1_Click()
    Dim Tick1_Click()
    Tick1_Click() = IIf(Range("D5") = True, False, True)
    Range("D5").Value = "TRUE"
    End Sub

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Click Shape to return TRUE value, Double Click to return FALSE value

    I was just giving you the code to use in your sub()

    Please Login or Register  to view this content.
    You can even use a 1 line version

    Please Login or Register  to view this content.
    Last edited by davesexcel; 09-13-2018 at 08:14 AM.

  5. #5
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    Re: Click Shape to return TRUE value, Double Click to return FALSE value

    You are a legend! The 1 liner worked! Thanks very much.

+ 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. [SOLVED] IF logical test pass return with 1st LOOKUP if true, if false then return with 2nd VLOOKUP
    By powerzasty in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-21-2017, 03:55 PM
  2. [SOLVED] make button single click to avoid user double click
    By Muzza1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2016, 01:02 AM
  3. Changing cell properties with double click, then revert with another double click
    By mweber2525 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-01-2014, 01:40 PM
  4. Double click row to return data to userform for edit then return back to sheet
    By MattRSJ in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 01-31-2014, 06:05 AM
  5. Click on shape to return message box of shape name
    By beat in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-11-2013, 01:06 PM
  6. [SOLVED] Double click on filtered value pivot table value will return wrong data
    By macroqmm9 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 03-11-2013, 11:52 AM
  7. Replies: 4
    Last Post: 08-02-2005, 09:05 PM

Tags for this Thread

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