+ Reply to Thread
Results 1 to 3 of 3

Add 1 to target on double click, add 0.5 on shift + double click

  1. #1
    Registered User
    Join Date
    09-08-2014
    Location
    -
    MS-Off Ver
    -
    Posts
    68

    Add 1 to target on double click, add 0.5 on shift + double click

    Hopefully the title is relatively descriptive.
    I currently have a relatively tedious task which involves slowly counting things. To make the process quicker I've used the following code:
    Please Login or Register  to view this content.
    This works great (I imagine the nested ifs could probably be made more concise but I'm not too fussed about that)
    Anyways, this may (is likely?) outside the scope of what VBA can do (or at least what I can do with VBA), but is there any way to add 0.5 instead of 1 if I've got shift (or any other specified key) held down?
    Your help is much appreciated.
    Lady Marmalade

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Add 1 to target on double click, add 0.5 on shift + double click

    Hello,

    Chip Pearson has an article on his website about testing key states;

    http://www.cpearson.com/excel/KeyTest.aspx
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    09-08-2014
    Location
    -
    MS-Off Ver
    -
    Posts
    68

    Re: Add 1 to target on double click, add 0.5 on shift + double click

    Quote Originally Posted by sweep View Post
    Hello,

    Chip Pearson has an article on his website about testing key states;

    http://www.cpearson.com/excel/KeyTest.aspx
    It worked perfectly! Thank you so much; I had to disable the Alt + Click function of excel which automatically opens the research pane, but it's brilliant.
    Quick unrelated question - your signature says to never merge cells. Care to explain why? Just for my general knowledge
    Thanks

+ 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] Before double click event with if statements (Double clicking blank cell stops bdc firing)
    By camdenpars in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-27-2014, 09:03 AM
  2. 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
  3. Copy double-clicked cell to next empty row in different sheet with each double-click
    By erhathaway in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-25-2013, 12:06 AM
  4. [SOLVED] userform label double-click goes to click event
    By John Paul Fullerton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2006, 01:00 PM
  5. [SOLVED] Click on graph bar to execute a double-click in a pivot table cell
    By Bill_F_Lyle@fpl.com in forum Excel Charting & Pivots
    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