+ Reply to Thread
Results 1 to 5 of 5

Looking for a way to pause a Sub until the user hits the Enter key

  1. #1
    Registered User
    Join Date
    06-14-2020
    Location
    Missouri, USA
    MS-Off Ver
    Office 365
    Posts
    48

    Looking for a way to pause a Sub until the user hits the Enter key

    Hi all,

    I'm looking for a way for a way to let the first part of a sub run to a certain point and then not go any further until the user hits either the Enter key or the space bar.
    The sub isn't far enough along to share. It probably wouldn't make sense if you saw it.
    I was hoping this would be relatively simple without the code.

    If this turns out not to be easy without the code I'll try to get something together.

    Thanks!

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

    Re: Looking for a way to pause a Sub until the user hits the Enter key

    Would
    Please Login or Register  to view this content.
    do what you want.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Valued Forum Contributor saravnepali's Avatar
    Join Date
    01-14-2019
    Location
    Sydney Australia
    MS-Off Ver
    2010
    Posts
    447

    Re: Looking for a way to pause a Sub until the user hits the Enter key

    Try to put this code - i assumed that the code is run through userform
    Please Login or Register  to view this content.
    If you think someone helped you, click on the "* Add Reputation" as a way to say thank you.

    If your problem is solved, go to Thread Tools and select Mark This Thread Solved

  4. #4
    Registered User
    Join Date
    06-14-2020
    Location
    Missouri, USA
    MS-Off Ver
    Office 365
    Posts
    48

    Re: Looking for a way to pause a Sub until the user hits the Enter key

    Thank you saravnepali ,

    I think this is what I am looking for.
    I'll probably have some kind of "Do Until" loop and then then insert your code so the user has to press the enter key before they advance.
    I'll give it a try and let you know.

  5. #5
    Registered User
    Join Date
    06-14-2020
    Location
    Missouri, USA
    MS-Off Ver
    Office 365
    Posts
    48

    Re: Looking for a way to pause a Sub until the user hits the Enter key

    saravnepali,

    I finally got the rest of the code working and I tried inserting a "Call" for your Sub but when I ran debug it says "Argument not optional".
    Below is the code where I inserted your sub.
    The "call" for the sub should be on line 59.
    I would like to use your sub and get rid of the message box on lines 60 and 61.
    Hopefully seeing my code will help show what I am trying to do.
    Also I actually think using the "down arrow" key press might be better.
    Would it be a little different code?
    Thanks

    Please Login or Register  to view this content.

+ 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. To stay put in target cell when no value is entered & the user hits ENTER
    By MannStewart in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-01-2020, 10:26 AM
  2. Replace . with / in column as soon as hits enter
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2019, 09:29 AM
  3. Replace date in "DD.MM.YYYY" with date "DD/MM/YYYY" format as soon as user hits enter
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2019, 09:12 AM
  4. [SOLVED] Date separated by DOT to automatially convert into Slash as soon as user hits enter
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2018, 11:19 AM
  5. Format a row when user hits enter
    By jcmckeon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-29-2014, 01:42 PM
  6. Detect if user hits cancel from user input type box
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2011, 11:42 AM
  7. Pause macro for user input then search for user's answer across multiple sheets
    By sassy2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-04-2009, 03:55 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