+ Reply to Thread
Results 1 to 7 of 7

Worksheet_BeforeDoubleClick (allow if cell is numeric)

  1. #1
    Registered User
    Join Date
    08-16-2016
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    88

    Worksheet_BeforeDoubleClick (allow if cell is numeric)

    Hi, I'm using the Worksheet_BeforeDoubleClick option. I have set the range as follows:

    Please Login or Register  to view this content.
    Is there a way to also restrict this to only cells that are numeric, if the cell contains anything else then cancel.

    Thanks

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Worksheet_BeforeDoubleClick (allow if cell is numeric)

    The way your code is written, the "Cancel=True" line will be executed if you double click any cell outside of your target range. Is this what you want? Please explain in detail what you want to accomplish using a few examples and referring to specific cells and ranges. Attach a sample workbook if possible.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    08-16-2016
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    88

    Re: Worksheet_BeforeDoubleClick (allow if cell is numeric)

    Hi,

    If the user clicks outside the range "D11:I19" then I want to cancel yes.
    But also cancel if the user clicks within the range "D11:I19" and the cell value is not numeric

    So looking at it the opposite way, the allowed range is "D11:I19" where a cell in that range contains a number. In English it would be range ""D11:I19" and is a number

    I hope that makes sense?

    Thanks

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Worksheet_BeforeDoubleClick (allow if cell is numeric)

    Try this as first line of sub

    Please Login or Register  to view this content.
    Last edited by kev_; 11-29-2017 at 11:46 AM.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Worksheet_BeforeDoubleClick (allow if cell is numeric)

    Try:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-16-2016
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    88

    Re: Worksheet_BeforeDoubleClick (allow if cell is numeric)

    Hi guys, thanks for the replies! You've sorted it :D

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Worksheet_BeforeDoubleClick (allow if cell is numeric)

    Glad to help.

+ 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. Goto a named cell using Worksheet_BeforeDoubleClick(
    By Daniel Brown in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2015, 10:04 AM
  2. Extract numeric value from a cell where Text and Numeric combined in a cell
    By Chandrahaas in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-07-2014, 10:58 AM
  3. [SOLVED] Sub Worksheet_BeforeDoubleClick
    By ana.ciofrangeanu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2014, 10:31 AM
  4. Worksheet_BeforeDoubleClick Not Working
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2014, 06:50 AM
  5. Replies: 4
    Last Post: 09-16-2010, 12:22 AM
  6. only extract numeric value from alpha numeric cell
    By Fam via OfficeKB.com in forum Excel General
    Replies: 5
    Last Post: 04-26-2006, 01:55 PM
  7. [SOLVED] Sub Worksheet_BeforeDoubleClick from elsewhere?
    By Jack Sons in forum Excel General
    Replies: 2
    Last Post: 11-02-2005, 06:17 PM

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