+ Reply to Thread
Results 1 to 6 of 6

anyone know VBA code just press enter, data will appear?

  1. #1
    Registered User
    Join Date
    04-02-2022
    Location
    Surabaya, Indonesia
    MS-Off Ver
    365
    Posts
    1

    Exclamation anyone know VBA code just press enter, data will appear?

    so i've just make filter based on VBA Code, but for show the data i must press command button
    maybe there are VBA Code to show data without press command button but just press enter?

    thank you before

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,208

    Re: anyone know VBA code just press enter, data will appear?

    You should probably be interested in the OnKey method.

    Artik

  3. #3
    Forum Contributor
    Join Date
    10-02-2012
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    251

    Re: anyone know VBA code just press enter, data will appear?

    OnKey/KeyPress events only work on UserForms. You will need to call in an API if you wish to use them on a WorkSheet.

    Alternatively you can create a stand alone macro to perform the action, and then use Excels built-in ability to bind macro to a keyboard shortcut.

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: anyone know VBA code just press enter, data will appear?

    Quote Originally Posted by PrizeGotti View Post
    OnKey/KeyPress events only work on UserForms...
    Sorry, but disagree. Application.OnKey is available on a worksheet. Obviously it needs to be assigned (and cleared) with code but it can be used as long as Excel is not in edit mode

  5. #5
    Forum Contributor
    Join Date
    10-02-2012
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    251

    Re: anyone know VBA code just press enter, data will appear?

    Application.OnKey isn't an event, it's to listen while a macro is running. Ideally you don't want the macro running constantly.

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: anyone know VBA code just press enter, data will appear?

    OK. I'm wrong. The OP was looking to run a procedure without having click a button. The Application.OnKey method is probably one way to do that. Who cares if it is a Method or Event but feel free to shoot down my answer on semantics?
    Last edited by cytop; 04-21-2022 at 10:01 AM.

+ 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. Insert Line of data press enter and repeat
    By Spike_105 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-29-2020, 01:06 PM
  2. HOW to press click or enter for this code and webpage.
    By pra123 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-18-2016, 06:55 AM
  3. Copy cell data to webform and press ENTER
    By randooom in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-08-2014, 05:53 PM
  4. [SOLVED] Press Enter To Run Macro
    By Bmiller109 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2013, 04:47 PM
  5. [SOLVED] keep having to press enter
    By louise2613 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-18-2012, 09:22 AM
  6. [SOLVED] When I Press the Enter Key Nothing happens.
    By bigev in forum Excel General
    Replies: 1
    Last Post: 03-01-2006, 11:10 AM
  7. Press Enter in TextBox
    By d61helix in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-14-2005, 11:35 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