+ Reply to Thread
Results 1 to 4 of 4

Pressing TAB or Enter Key on Protected Worksheet

  1. #1
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Pressing TAB or Enter Key on Protected Worksheet

    Greetings,
    I have a Worksheet where all the cells are Protected - I am using "Private Sub Worksheet_BeforeDoubleClick(ByVal target As Range, Cancel As Boolean)" to open several different UserForms. The issue is if the Tab or Enter keys are pressed, the Workbook "locks" up and becomes unresponsive. I am needing code that will prevent this from happening and possibly display a custom MsgBox instructing the user not to press either the Tab or Enter Key.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Pressing TAB or Enter Key on Protected Worksheet

    In your BeforeDoubleClick event, are you setting Cancel to True as well as opening the userforms?

    When are the Enter keys that lock things up being pressed? When the userforms are open (are they modal or modeless)? or before?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: Pressing TAB or Enter Key on Protected Worksheet

    mikerickson,
    Thank you for your reply!
    Yes on setting Cancel = True. Regarding the Enter Key, I just realized it is works okay. I'm not sure when the userforms are opened in modal or modeless?

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Pressing TAB or Enter Key on Protected Worksheet

    Modal UserForms lock out Excel resources (only the UserForm is active) and are started as:
    Please Login or Register  to view this content.

    Modeless UserForms allow access to Excel resources (you can access the Spreadsheet) and are started as:
    Please Login or Register  to view this content.
    Lewis

+ 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] Help with Worksheet Change command to change Cell value without pressing Enter key
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2016, 12:30 PM
  2. No Cell Movement after Pressing Enter with this macro I'm using on a protected sheet
    By Janet_824 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2016, 02:59 PM
  3. [SOLVED] Enter the name of the worksheet (tab) in Textbox and after pressing the button to go to Sh
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2012, 10:15 PM
  4. [SOLVED] Change event problem when the user switches worksheet without pressing ENTER
    By franklyn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-05-2012, 08:12 PM
  5. [SOLVED] how can I enter a comment in a protected worksheet?
    By Jack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2006, 03:23 PM
  6. [SOLVED] Enter comments in a protected Excel worksheet
    By SUE D in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-21-2005, 12:05 PM
  7. [SOLVED] Tab/Enter key moves to next available cell in protected worksheet
    By LMSCHIER in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-19-2005, 06:18 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